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.

Invocation Result
shki dump SQL to stdout.
shki dump --format json --output f.json A JSON Snapshot, the same format shki records internally.
shki dump --dirs --output schema A Directory Schema: main.sql, extensions/, and schema-scoped object directories.
shki dump --dirs Preview of that directory layout, written nowhere.
Flag Purpose
-f, --format <json|sql> Output format. Default sql.
--output <PATH> Output file or directory. Defaults to stdout/preview.
--dirs Emit a Directory Schema instead of a single file.
--force Overwrite 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.