import type { AsyncClient } from '../types.js'; /** * Structural type matching `pg.Pool` (or a `pg.PoolClient` from `pool.connect()`). * Sqlfu binds against this shape rather than the concrete pg classes so * users can pass mocks / wrappers / proxy clients (pgbouncer-aware * pools, retrying clients, instrumentation shims, etc.) without sqlfu * needing to know about them. * * The minimum surface sqlfu needs: * - `query(text, values?)` → `{rows, rowCount}`-shaped result * - `connect()` → a session-bound queryable with `release()` for transactions */ export interface NodePostgresLike { query = Record>(text: string, values?: unknown[]): Promise>; /** * Acquire a session-bound queryable. Used for transactions: begin/commit * are sent on the same connection. Implementations must return a queryable * with a `release()` method that returns it to the pool. */ connect?(): Promise; } export interface NodePostgresQueryResult = Record> { rows: TRow[]; rowCount?: number | null; command?: string; /** Optional pg-specific oid for the inserted row's primary key, when applicable. */ oid?: number; } export interface NodePostgresPoolClientLike { query = Record>(text: string, values?: unknown[]): Promise>; release(err?: unknown): void; } export declare function createNodePostgresClient(pool: NodePostgresLike): AsyncClient; export declare const createNodePostgresDatabase: typeof createNodePostgresClient;