Docs/Commands/data
Progenerated from cli/_parser_setup.py

dblift data

Audited DML for one-off corrections. new, plan, apply and status are Pro. DBLift does not keep a copy of the rows and does not reverse the correction. Corrections live in named data sets in your config; every apply is written to an audit ledger. See Data corrections. DBLift does not offer data undo or before/after row capture.

Synopsis

$ dblift data {new,plan,apply,status} ...

Options

FlagDescription

No command-specific options. Global flags still apply.

What each licence unlocks

The data command is Pro. new, plan, apply and status run on Pro. A Pro apply records the ledger and does not keep a copy of the rows. Schema rollback stays the open-core undo command, with a hand-written U script. DBLift does not offer data undo or before/after row capture.

SubcommandLicence
newPro. Writes a file. No database.
planPro. Impact and plan-time policy checks. No row data.
applyPro. Ledger row. No row-image capture.
statusPro

Subcommands

planPro

Build a static, reviewable plan from pending correction files. Reports triggers, foreign-key children, and plan-time policy violations. The plan contains no row data and no undo verdict.

dblift data plan [-h] --dataset DATASET [--output OUTPUT]
                        [--format {text,json}]
--datasetData set name (from dblift.yaml data_sets)
--output, -oWrite plan JSON
--formatOutput format (default: text)

applyPro

Execute a reviewed plan file, enforce row-count expectations, and write the audit ledger. It does not capture before/after row images.

dblift data apply [-h] [--force] [--format {text,json}] plan_file
plan_filePath to plan.json from 'data plan'
--formatOutput format (default: text)

statusPro

List each correction in the data set and verify the audit ledger. While a leftover dblift_data_change_set table holds rows, status prints a notice on stderr.

dblift data status [-h] --dataset DATASET [--format {text,json}]
--formatOutput format (default: text)

newPro

Create a correction file. Never overwrites an existing file and does not open a database.

dblift data new [-h] [--dataset DATASET] [--table TABLE]
                       [--expect EXPECT] [--onfail {halt,skip,warn}]
                       [--format {text,json}]
                       description
descriptionShort description; becomes the file name slug
--datasetData set name (from dblift.yaml data_sets)
--tableTable to put in the placeholder statement
--expectDefault expect= directive (1, >=N, <=N, any)
--onfailDefault onfail= directive
--formatOutput format (default: text)

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

Examples

Pro — scaffold a correction file. Refuses to overwrite.

$ dblift data new "activate user" --dataset customer_risk

Pro — produce a plan a reviewer can read, with no row data in it

$ dblift data plan --dataset customer_risk --output plan.json

Pro — apply the reviewed plan

$ dblift data apply plan.json

Pro — read the audit ledger as JSON

$ dblift data status --dataset customer_risk --format json

Exit codes

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