import { drizzle } from 'drizzle-orm/postgres-js'; import postgres from 'postgres'; import { config } from '../config.js'; import * as schema from './schema.js'; const client = postgres(config.DATABASE_URL, { max: 20, idle_timeout: 20, connect_timeout: 10, }); export const db = drizzle(client, { schema }); export async function closeDb(): Promise { await client.end(); }