import { ClientBase, Pool, PoolClient, QueryResult } from 'pg'; export interface ExecOptions { client: Pool | ClientBase; context?: Record; query: string; variables?: any[]; skipTransaction?: boolean; } declare function pgQueryContext({ client, context, query, variables, skipTransaction }: ExecOptions): Promise; export default pgQueryContext; export interface WithPgClientOptions { skipTransaction?: boolean; } /** * Execute a callback within a tenant-scoped RLS transaction. * * Acquires a client from the pool, applies pgSettings via set_config * (scoped to the transaction), calls the callback, then commits or * rolls back. The client is always released back to the pool. * * Use this when you need to run multiple queries within the same * RLS context (e.g., auth check + data mutation). */ export declare function withPgClient(pool: Pool, context: Record, fn: (client: PoolClient) => Promise, opts?: WithPgClientOptions): Promise;