/** * Thrown when code running inside a transaction asks for a connection from the * pool whose only connection that transaction already holds. Waiting can never * succeed, so the caller gets this immediately instead of after every acquire * timeout and retry. It is deliberately not a connection error: retrying a * deadlock only repeats it. */ export declare class DbPoolSelfDeadlockError extends Error { readonly code = "DB_POOL_SELF_DEADLOCK"; constructor(operation: string); } /** Marks `run`, and everything it awaits, as holding `pool`'s connection. */ export declare function runHoldingPoolConnection(pool: object | undefined, run: () => T): T; /** * TRAP: only a pool that provably has one connection can deadlock itself. A * pool whose size is unreadable is left to the acquire timeout rather than * failed on a guess. */ export declare function assertPoolConnectionAvailable(pool: object, operation: string): void;