/** * Read a database's `public` schema back out of the catalog: as replayable SQL * (an upgrade fixture today, the Phase 2 install snapshot later) and as a * comparable fingerprint. Catalog queries only, so it works on PGlite, which * has no `pg_dump`. */ import type { DbExec } from "./client.js"; export interface SchemaFingerprint { tables: string[]; columns: string[]; indexes: string[]; constraints: string[]; } export interface DumpSchemaOptions { /** Also emit the rows of every migration bookkeeping table. */ withBookkeepingRows?: boolean; /** Leave these tables, and their constraints, indexes and triggers, out. */ skipTable?: (table: string) => boolean; } /** Replayable SQL for the schema plus the rows of every bookkeeping table. */ export declare function dumpSchemaSql(exec: DbExec): Promise; /** * The schema as an ordered list of statements, each safe to send on its own. * Function bodies contain semicolons, so the statements cannot be joined and * split again. */ export declare function dumpSchemaStatements(exec: DbExec, options?: DumpSchemaOptions): Promise; /** Order-independent description of the schema, for comparing two databases. */ export declare function schemaFingerprint(exec: DbExec): Promise;