Skip to main content
Compares schemas and optionally row-level data between two build contexts: two targets (e.g. prod:dev) in standard mode, or two virtual environments when virtual mode is enabled. See Data Diffs for detailed usage.

Usage

sqb diff <FROM>:<TO> <mode> [flags]
The first argument is a positional FROM:TO range. Exactly one mode is required: --full, --schema-only, or --bounded <duration>.

Flags

FlagDescription
--fullCompare both schema and all row data
--schema-onlyCompare column names and types only
--boundedCompare row data within a recent window (e.g. 14d, 6h)
--verbose, -vShow more example rows (default: 3, verbose: 10)
--max-column-examplesOverride maximum examples per changed column
--max-row-only-examplesOverride maximum examples for side-only rows
--no-sql-validationSkip compile-time SQL syntax validation
--select, -sSelect specific models to diff (required in v1)
--excludeExclude specific models from diffing

Examples

# Full diff of a specific model
sqb diff prod:dev --full --select customer_status_snapshot

# Schema-only diff of all marts
sqb diff prod:dev --schema-only --select path:marts

# Bounded diff of last 14 days
sqb diff prod:dev --bounded 14d --select hourly_order_activity

Exit codes

Returns 0 when all selected models have no differences, 1 when any model has schema or row differences.