Skip to content

shki dump

Terminal window
shki dump [--format sql|json] [--dirs] [--output PATH] [--schema NAME] [--force]

Introspects the live database and renders its current shape. Reads only — it never modifies the database, and it does not touch migrations or the Journal.

InvocationResult
shki dumpSQL to stdout.
shki dump --format json --output f.jsonA JSON Snapshot, the same format shki records internally.
shki dump --dirs --output schemaA Directory Schema: main.sql, extensions/, and schema-scoped object directories.
shki dump --dirsPreview of that directory layout, written nowhere.
FlagPurpose
-f, --format <json|sql>Output format. Default sql.
--output <PATH>Output file or directory. Defaults to stdout/preview.
--dirsEmit a Directory Schema instead of a single file.
--forceOverwrite file collisions in directory mode.
--schema <NAME>Schema to dump (PostgreSQL, default public).
-u, --database-url <URL>Database to introspect. Env: DATABASE_URL.
Terminal window
shki dump # eyeball the live shape
shki dump --format json --output snapshot.json # capture a Snapshot
shki dump --dirs --output schema # start a Declarative Schema from it
shki dump --schema billing # a non-public schema
  • Works on PostgreSQL, MySQL, and SQLite; PostgreSQL has the richest catalog coverage.
  • To adopt an existing database, prefer shki bootstrap, which writes the Directory Schema and the baseline migration, Snapshot, and Journal entry in one step.

See also: Declarative Schema.