import { drizzle, type NodePgDatabase } from "drizzle-orm/node-postgres"; import { Pool } from "pg"; import * as schema from "./schema"; export * from "./schema"; export type DB = NodePgDatabase; export type Reminder = typeof schema.reminders.$inferSelect; export function createClient(databaseUrl: string): { db: DB; pool: Pool } { const pool = new Pool({ connectionString: databaseUrl }); const db = drizzle(pool, { schema }); return { db, pool }; }