import { drizzle } from 'drizzle-orm/postgres-js'; /** * Postgres connection for the default Drizzle store. * * Carries forward the connection hygiene the original package got right: * • cache the client on globalThis so Next.js dev HMR doesn't leak a fresh * pool on every reload (which eventually exhausts Supabase's pooler), * • `prepare: false` for the Supabase transaction-mode pooler, * • a small, bounded pool. * * The connection string is read from `DATABASE_URL` by default but can be * passed explicitly so a host app with multiple databases stays in control. */ type DrizzleDb = ReturnType>; interface DrizzleClientOptions { /** Postgres connection string. Defaults to `process.env.DATABASE_URL`. */ connectionString?: string; /** Max pool connections. Defaults to 5 (dev-friendly; raise in prod). */ max?: number; } /** * Get (or lazily create + cache) a Drizzle db for a connection string. Cached * by connection string so multiple stores over the same DB share one pool. */ declare function getDrizzleDb(options?: DrizzleClientOptions): DrizzleDb; export { type DrizzleClientOptions as D, type DrizzleDb as a, getDrizzleDb as g };