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 with
sqt deployment promote --latest.
Planning and building do not change what consumers read. sqt deployment audit reports whether a
deployment looks ready, but sqt deployment promote does not check that result, so audit before
you promote. Promotion binds the stable views to the staged deployment; rollback can later bind
the complete graph to a retained prior publication.
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. List all deployments, or show the newest one:
sqt deployment listsqt deployment show --latestInventory 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 --latestsqt 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 --latestsqt 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.
Set the thresholds deployment audit uses in sqltide_project.toml:
[defaults.deployment_readiness]maximum_lag = "30s"minimum_staged_row_ratio = 0.5Promote
Section titled “Promote”sqt deployment promote --latestPromotion points each stable view, such as tbl__orders, at the deployment’s table. ClickHouse
switches each view atomically, but SQLTide switches the views one at a time, not all together:
while promotion runs, a consumer that reads two models can see the new version of one and the old
version of the other. If promotion stops partway, run sqt deployment promote again with the same
deployment ID; it switches only the views that remain.
The CLI promotes without asking for confirmation; the UI shows a preview first.
Show, diff, audit, and promote take a deployment ID, or --latest for the most recently built
deployment. sqt deployment promote --latest refuses when that deployment is already published or
when more than one deployment is staged, and prints the ID it promotes.
From 0.68.1, promotion also refuses a deployment built on an upstream model version that is no
longer published. This happens when a deployment that changed only a downstream model is promoted
after another deployment published a new version of its upstream model. The error names the model;
rebuild it with sqt build --select <model> and promote that build.
Staged views that stopped receiving rows (fixed in 0.68.0)
Section titled “Staged views that stopped receiving rows (fixed in 0.68.0)”In virtual mode up to and including 0.67.3, a build that staged a model without staging the model it reads created that model’s materialized view on the upstream model’s stable view. ClickHouse never runs a materialized view for inserts into a view, so that version stopped receiving new rows as soon as its build finished, both before and after promotion. Builds that also staged the upstream model were not affected.
To check a target database, list the materialized views that read a view:
SELECT arrayJoin(dependencies_table) AS materialized_viewFROM system.tablesWHERE database = currentDatabase() AND engine = 'View';Each name ends with its deployment ID, and that deployment’s version of the model receives no new rows. Do not promote or roll back to any deployment listed here; rebuild the model instead.
After upgrading to 0.68.0, rebuild each affected model and promote it:
sqt build --select order_report --full-refreshsqt deployment promote --latestThe full refresh replays the source’s retained history, so rows that arrived while the old version
was stalled come back if the source still has them. The stalled deployment stays listed until
sqt janitor --apply removes it.
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. Rollback refuses a deployment that was never published, is already active, is
missing tables, or whose stable views no longer point where SQLTide last left them.
Operational commands
Section titled “Operational commands”sqt doctorsqt repair active-view --table tbl__orders --deployment-id 20260729T120000Z_ab12cdsqt reconcilesqt reconcile --applysqt janitorsqt janitor --retention-days 30 --applydoctordiagnoses stable-view and deployment-reference problems.repair active-viewpoints one broken logical view at a deployment thatdoctorlists for it.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.