Skip to main content

drt apply

Apply a plan only if recomputing it gives the same change set.

Nothing is written when the plan is stale, edited, from another drt major version, already applied, or when the world drifted since it was made. The write itself is the normal drt run path (rate limiting, DLQ, history, watermarks, alerts).

A directory applies each plan in file-name order and stops at the first one that is refused or fails; the plans before it stay applied.

Examples:

drt plan orders_to_pg --out plan.json
drt apply plan.json
drt apply plan.json --auto-approve --max-age 2h # in CI
drt apply plans/ --auto-approve # every plan from `drt plan --all`

Usage​

drt apply [OPTIONS] PLAN_FILE

Arguments​

ArgumentRequiredDescription
PLAN_FILEyesplan.json written by drt plan --out, or a directory of them (drt plan --all), applied in file-name order.

Options​

OptionTypeDefaultDescription
--auto-approveBOOLEANDo not prompt (required without a terminal, e.g. CI).
--approved-byTEXTWho approved this apply; recorded in the run results and the plan's claim.
--max-ageTEXT24hRefuse a plan older than this (30m, 24h, 7d).
--allow-drift-pctFLOAT0.0Proceed if at most this percent of the planned keys drifted (logged). Default 0.
--force-guardsBOOLEANApply even though a sync.guards limit trips (recorded in the run results).
--exactBOOLEANReplay the plan's encrypted .payload rows instead of extracting the source.
--keep-payloadBOOLEANRetain the encrypted sidecar after a successful --exact apply.
--cursor-valueTEXTThe cursor override the plan was made with (drt plan --cursor-value).
--output, -oTEXTtextOutput format: text or json.
--varsTEXTOverride project vars, as for drt run.
--profile, -pTEXTOverride profile.
--manifest-pathPATHdbt manifest for contract.source: dbt (default: target/manifest.json).