import { drizzle, type NodePgDatabase } from "drizzle-orm/node-postgres"; import type { Pool } from "pg"; import { accountSchema } from "./schema.js"; export type AccountDrizzleDatabase = NodePgDatabase; /** * A typed Drizzle view over an externally owned pool, exactly like `createDeviceDrizzleView`: it * never constructs, registers an error listener on, or closes a pool. */ export function createAccountDrizzleView(pool: Pool): AccountDrizzleDatabase { return drizzle(pool, { schema: accountSchema }); }