import type { PgDatabase, PgQueryResultHKT } from "drizzle-orm/pg-core"; /** * Routes `getDb()` and `getDbExec()` calls made inside a root transaction of * `db` onto that transaction, and marks the transaction as holding `pool`'s * connection. `pool` is the shared pool `db` was built over. * * TRAP: every Drizzle instance built over a shared pool needs this. One that * does not leaves a callback inside its transaction asking the same pool for a * second connection, which on a one-connection pool never arrives. */ export declare function scopeDbToPoolTransactions(db: T, pool: object, getActivePool?: () => object): T; /** * Returns true when a SQL string starts with a SELECT-class verb. * Used by the Neon resilience wrapper to decide retry safety: * - reads (SELECT) → retryable on any connection-class error * - writes (INSERT/UPDATE/DELETE/…) → only retryable on errors that * provably occurred BEFORE the statement was sent (e.g. an acquire / * connect timeout). Post-send write failures must propagate to the caller * to avoid double-execution. */ export declare function isSqlRead(sql: string): boolean; export declare function buildResilientNeonPool; query(...args: any[]): Promise; end(): Promise; on(event: string, listener: (...args: any[]) => void): unknown; }>(pool: T, getActivePool?: () => object): T; export declare function buildResilientPostgresJsClient(client: T, getActivePool?: () => object): T; export declare function isNeonUrl(url: string): boolean; export declare function createGetDb>(schema: T): () => PgDatabase;