Docs/Commands/snapshot
Enterprisegenerated from cli/_parser_setup.py

dblift snapshot

Export a database schema snapshot to a JSON model file. The snapshot is what plan and preflight read to reason about a target environment they cannot connect to.

Synopsis

$ dblift snapshot [publish] [--output PATH] [--source SOURCE]
                 [--min-confidence SCORE]
                 [--table TABLE] [--snapshot-table TABLE]

Options

FlagDescription
--tableCustom schema history table name (default: dblift_schema_history)
--snapshot-tableCustom schema snapshot table name (default: dblift_schema_snapshots)
actionOptional action. 'publish' exports the latest stored snapshot to the active environment's snapshot.source (file: writes JSON + integrity manifest; db: is an intentional no-op). Select the environment with --env / DBLIFT_ENV.
--outputOutput file path for the snapshot JSON model (default: snapshot.json; for 'publish' this overrides the environment's snapshot.source path)
--sourceSource for snapshot data: 'database-stored' (default) loads latest from database, 'live-database' captures new snapshot from live database introspection
--min-confidenceMinimum acceptable snapshot confidence score (0.0-1.0). When a live-database snapshot scores below SCORE the command fails. Useful to bypass HIGH-only gating against emulators (e.g. --min-confidence 0.4).
--redactStrip table/column comments and tokenise their names before writing the snapshot; the original-name mapping goes to a <output>.redaction.json sidecar (git-ignore it — it is the key to reversing the tokenisation)

Global flags apply to every command: --config, --env, --scripts, --dry-run, --quiet, --log-level. See global flags.

Examples

Capture production's current shape

$ dblift snapshot --source live-database --output prod-snapshot.json

Publish the stored snapshot to the environment's configured location

$ dblift --env production snapshot publish

Accept a lower confidence score when running against an emulator

$ dblift snapshot --source live-database --min-confidence 0.4

Exit codes

CodeMeaning
0Command completed successfully
4A paid-edition feature was invoked without a valid licence (EXIT_LICENSE_REQUIRED)
On this page