Operate and deploy
Virtual Environments
Opt-in staged builds, inventory, readiness assessment, promotion, and lifecycle operations.
Virtual environments preserve SQLTide’s versioned deployment workflow. Use virtual mode as the project default:
[defaults]pipeline_mode = "virtual"Alternatively, set mode = "virtual" in an individual pipeline.toml.
The lifecycle is:
- Write typed SQL and validate it with
sqt compile. - Read the proposed work with
sqt plan. - Build a separate version with
sqt buildand inspect its results. - Publish it explicitly with
sqt deployment promote <deployment_id>.
Planning and building do not affect the published graph. Inspection and a deployment audit inform the operator, but the resulting readiness assessment is advisory rather than a promotion lock. Promotion binds the stable views to the staged deployment; rollback can later bind the complete graph to a retained prior publication.
In this workflow, audit is the operation and assessment is its overall result. The deployment
audit combines staged-versus-active comparisons, replay coverage, and applicable SQL data-quality
audits into a ready, caution, or not_ready assessment.
sqt build --auto-approvesqt build --select orders --full-refresh --auto-approvesqt build --select orders --start-time 2026-07-01T00:00:00Z --auto-approveBuild creates deployment-specific model objects while the active stable views remain unchanged:
tbl__orders__20260729T120000Z_ab12cdmv__orders__20260729T120000Z_ab12cdThe deployment ID is generated as YYYYMMDDTHHMMSSZ_<six-hex> unless supplied with
--deployment-id.
Discover and inspect
Section titled “Discover and inspect”Build prints the generated ID. You can also reconstruct inventory from authoritative warehouse evidence:
sqt deployment listsqt deployment show 20260729T120000Z_ab12cdInventory distinguishes active, staged, superseded, incomplete, metadata-missing, and physical-missing deployments. List and show are read-only.
The development UI exposes the same inventory and deployment detail, including scoped lineage, staged-versus-live changes, promotion preview, resumable partial promotion, and retained rollback guidance. Cleanup is also available from the deployment list. Audit and rollback remain explicit CLI operations.
Compare the active graph with a retained deployment, or compare two explicit endpoints:
sqt deployment diff 20260729T120000Z_ab12cdsqt deployment diff 20260729T120000Z_ab12cd:20260730T120000Z_cd34efDiff reports added, removed, changed, unchanged, and physically missing model relations using model
presence, schemas, physical availability, and current row counts. Either explicit endpoint may be
active.
Audit staged data
Section titled “Audit staged data”sqt deployment audit 20260729T120000Z_ab12cdsqt deployment audit compares staged and active data, checks replay coverage, runs applicable SQL
audits, and reports an overall assessment:
readymeans the available evidence satisfies the configured freshness and row-count checks and no error-severity SQL audit failed.cautionmeans the evidence is incomplete or warrants review, such as unavailable freshness evidence, missing replay partitions, or a staged row count below the configured ratio.not_readymeans a stronger negative signal was found, such as lag beyond the configured limit, an empty staged relation replacing a populated active relation, or a failed error-severity SQL audit.
Warning-severity SQL audit failures appear in the results but do not by themselves change the overall assessment.
Configure the advisory replay thresholds in committed project configuration:
[defaults.deployment_readiness]maximum_lag = "30s"minimum_staged_row_ratio = 0.5Promote
Section titled “Promote”sqt deployment promote 20260729T120000Z_ab12cdPromotion creates or replaces stable views such as tbl__orders to read from the selected deployment
table. ClickHouse replaces each relation atomically, but the complete graph is not graph-atomic:
bindings are switched one relation at a time and SQLTide reports that capability in output.
Before promotion, consumers reach deployment A through the unsuffixed stable view and deployment B remains staged. Promotion replaces that view definition so it reads deployment B. The replacement is atomic for this one relation only; a multi-model graph can be partly switched if promotion stops, and retry applies the remaining bindings.
The UI provides a promotion preview. The CLI deployment promote command executes without a
confirmation prompt; inspect the deployment before running it. If promotion stops after switching
only part of the graph, the deployment remains retryable and the next promotion applies only the
remaining changes.
Show, audit, and promote require explicit positional IDs. There is no automatic sole-candidate or latest-candidate selection.
Roll back
Section titled “Roll back”Roll back the complete stable graph to the immediately preceding distinct publication or an explicit previously published deployment:
sqt deployment rollback --previoussqt deployment rollback 20260729T120000Z_ab12cdRollback requires confirmation unless --auto-approve is supplied. JSON mode also requires
--auto-approve. SQLTide rejects staged, unpublished, already-active, missing, and drifted
targets rather than guessing from partial state.
Operational commands
Section titled “Operational commands”sqt doctorDEPLOYMENT_ID="replace-with-deployment-id"sqt repair active-view --table tbl__orders --deployment-id "$DEPLOYMENT_ID"sqt reconcilesqt reconcile --applysqt janitorsqt janitor --retention-days 30 --applydoctordiagnoses stable-view and deployment-reference problems.repair active-viewpoints one broken logical view at a known deployment.reconcilepreviews or records a compatible live metadata baseline.janitorpreviews or removes stale deployment objects while protecting active and rollback-retained state.
Promotion, rollback, repair, reconciliation, and janitor operations must not overlap against the same target database.
These commands are virtual-environment-only. There is no automatic mode conversion or direct-mode equivalent.