/** * PostgresAuditSink — durable AuditSink adapter backed by PostgreSQL. * * Companion schema: src/manifest/audit/sinks/postgres.sql. * Uses the `pg` client (already a Manifest dependency for stores.node.ts). * * Idempotency: enforced at the SQL layer via * INSERT … ON CONFLICT (record_id) DO NOTHING * so retries from a buggy upstream consumer never double-write. * * Transactionality: this adapter inserts on its own connection by default. * Callers who need audit emission inside a larger transaction should pass * a PoolClient already bound to that transaction via `client`. * * DO NOT import this file in browser code — it requires `pg`. */ import type { Pool, PoolClient } from 'pg'; import type { AuditRecord, AuditSink } from '../audit-sink'; export interface PostgresAuditSinkOptions { /** A pg Pool. The sink does NOT own the pool's lifecycle. */ pool: Pool; /** Table name override. Default: `manifest_audit_records`. */ tableName?: string; } export declare class PostgresAuditSink implements AuditSink { private pool; private tableName; constructor(opts: PostgresAuditSinkOptions); emit(record: AuditRecord, client?: PoolClient): Promise; } //# sourceMappingURL=postgres.d.ts.map