Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sqlbuild.com/llms.txt

Use this file to discover all available pages before exploring further.

In virtual mode, sqb diff compares VDE ref sets within the same physical environment. It shows which models have different version hashes and, for changed models, reports schema and row-level differences.

Basic usage

sqb diff dev:pr_123
The format is <left_vde>:<right_vde>. Both VDEs must exist in the active physical environment’s state store.

What diff shows

  1. Ref comparison - which models have different version hashes between the two VDEs
  2. Schema differences - column additions, removals, and type changes for changed models
  3. Row differences - row counts, matched/unmatched rows, and changed column values
Identical refs are skipped by default so the output focuses on models that actually differ. A model with a different version hash is included in the comparison even if its resulting data happens to be identical.

Options

# Schema differences only (no row comparison)
sqb diff dev:pr_123 --schema-only

# Full row-level comparison
sqb diff dev:pr_123 --full

# Compare specific models
sqb diff dev:pr_123 --select fact_orders

# No color output
sqb --no-color diff dev:pr_123

Working VDE guard

If either VDE is working (has stale models that haven’t been built yet), diff is blocked by default because the comparison may be incomplete:
# Blocked
sqb diff dev:pr_123

# Allowed with explicit override
sqb diff dev:pr_123 --allow-partial-diff
This guard prevents misleading diff output when one VDE has pending changes that haven’t been materialized yet.

Comparison with direct-mode diff

In direct mode, sqb diff prod:dev compares physical environment schemas and data directly in the warehouse. In virtual mode, sqb diff dev:pr_123 compares VDE pointer sets within a single physical environment, then inspects the physical versions those pointers reference. The output format is the same - schema diffs, row counts, changed columns, and example rows. The difference is what is being compared: physical environments vs virtual pointer sets.