Sifa professional network API (Fastify, AT Protocol, Jetstream) sifa.id/
at main 10 lines 323 B view raw
1import { drizzle } from 'drizzle-orm/node-postgres'; 2import pg from 'pg'; 3import * as schema from './schema/index.js'; 4 5export function createDb(connectionString: string) { 6 const pool = new pg.Pool({ connectionString, max: 10 }); 7 return drizzle(pool, { schema }); 8} 9 10export type Database = ReturnType<typeof createDb>;