import type { DB, TransactionConfig } from './index.js'; export declare function pipe(name?: string): DB; export declare namespace pipe { var transaction: (nameOrFn: string | ((tx: DB) => Promise), maybeFnOrConfig?: ((tx: DB) => Promise) | TransactionConfig, maybeConfig?: TransactionConfig) => Promise; } /** * The unwrapped database handle — bypasses the scoped/guard proxies that * normally wrap `pipe()`. The audit-write CTE path uses this to run the * compiled statement via `.execute()`, which the scoped proxy refuses (CTEs * bypass per-table tenant filtering by design). The compiled SQL is already * tenant-scoped at compile time when `ctx.tenant !== null` — the audit CTE * is built against the scoped `pipe()` DB, so the user write inside the CTE * picks up the tenant filter naturally; this raw handle is only the carrier. */ export declare function pipeRaw(name?: string): DB; /** * The system channel — deliberate cross-tenant database access for surfaces * that legitimately operate without a tenant in context: pre-tenant auth * (membership resolution during login), public webhook ingress, admin tooling. * * Unlike `pipe()`, the handle is never tenant-scoped and never tenant-guarded. * Unlike `pipeRaw()`, it does not return the request's bound transaction — it * resolves the owner-role pooled connection, outside the request/job * transaction. The bound transaction authenticates as the runtime app role * and is RLS-bound fail-closed, so an unscoped query inside it would silently * return zero rows once role separation is on; the owner connection is the * only honest carrier for a cross-tenant read. Queries here see committed * data only and do not participate in request atomicity. * * Under collapsed test isolation (a pool override is registered for the * database) every role shares the single rolled-back connection, and that * connection is reserved by the open transaction — joining the bound * transaction is then the only non-deadlocking route, and the owner/app * distinction is already collapsed. */ export declare function pipeSystem(name?: string): DB; //# sourceMappingURL=db.d.ts.map