Skip to content

Instantly share code, notes, and snippets.

View timalander's full-sized avatar

Tim Alander timalander

View GitHub Profile
@rphlmr
rphlmr / clear-db.ts
Last active July 22, 2024 12:56
Drizzle snippets
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406
import { sql } from "drizzle-orm";
const clearDb = async (): Promise<void> => {
const query = sql<string>`SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE';
`;