import type { DbAdapter, PreparedStatement, RunResult } from './sqlite-adapter.js'; /** * Translate the closed set of SQLite date/time idioms the economy query layer * uses into Postgres equivalents. Runs AFTER `translateSql` (so `?` are already * `$n`). Timestamp columns are stored as ISO-8601 TEXT in both dialects, so bare * `DATE(col)` casts through `timestamptz`. Ordered most-specific first. */ export declare function translateSqliteDates(sql: string): string; /** * Connection-level failures where the query provably never executed (the pool * could not hand out or keep a live backend). These are safe to retry once — * the pg pool discards the dead client and dials a fresh one on the next query, * so a single retry transparently absorbs RDS failover / idle-drop / connect * timeout blips instead of surfacing a 500 the caller has to retry by hand. */ export declare function isTransientConnError(message: string): boolean; export declare class SyncPgAdapter implements DbAdapter { private readonly worker; private readonly port; private counter; private readonly sleeper; constructor(dsn: string); /** * Drain the reply matching `expectedId`. The reply is enqueued on the port * before the worker notifies, but cross-thread delivery can lag under CPU * pressure — so poll on a wall-clock deadline (yielding via a 1ms Atomics.wait * between empty reads) rather than a fixed iteration count, which could give * up prematurely on a busy box and throw a spurious 500. Replies whose id does * not match are stale results of a previously abandoned (timed-out) query; * discard them so the port never cross-talks between requests. */ private drainReply; private queryOnce; private query; run(sql: string, ...params: unknown[]): RunResult; get(sql: string, ...params: unknown[]): unknown; all(sql: string, ...params: unknown[]): unknown[]; exec(sql: string): void; prepare(sql: string): PreparedStatement; transaction(fn: () => T): T; close(): void; } //# sourceMappingURL=sync-pg.d.ts.map