/** * Structural catalog snapshot + equivalence check, used by * `pgpm transform --check` to prove a transform is lossless: deploy the * original and the transformed module(s) into two scratch databases and * assert the resulting catalogs describe the same schema. * * The snapshot is intentionally order-insensitive per object class (objects * are keyed by identity and compared by definition), but column order within * a table IS part of the comparison — the dials pipeline preserves it. */ /** Minimal query surface: satisfied by pg Pool/PoolClient and test clients. */ export interface CatalogQueryable { query(text: string): Promise<{ rows: any[]; }>; } /** Catalog snapshot: object identity -> normalized definition. */ export interface CatalogSnapshot { schemas: Record; tables: Record; columns: Record; constraints: Record; indexes: Record; functions: Record; triggers: Record; policies: Record; rls: Record; grants: Record; } /** * Snapshot the user-schema surface of a database: schemas, tables, columns, * constraints, indexes, functions, triggers, policies, RLS flags, and table * grants. System schemas, `public`, and the pgpm ledger are excluded. */ export declare const snapshotCatalog: (db: CatalogQueryable) => Promise; /** * Column-order-insensitive view of a snapshot. Migrations that drop and add * columns can never reproduce a fresh deploy's physical column order * (Postgres appends), so migration-equivalence checks (`pgpm diff --verify`) * compare columns by name and definition only. */ export declare const withoutColumnOrder: (snap: CatalogSnapshot) => CatalogSnapshot; /** * Compare two catalog snapshots. Returns a flat list of human-readable * differences; an empty list means the catalogs are structurally equivalent. */ export declare const diffCatalogSnapshots: (a: CatalogSnapshot, b: CatalogSnapshot) => string[];