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.

sqb diff

Compares schemas and optionally row-level data between two environments. See Environment Diffs for detailed usage.

Usage

sqb --project-dir <path> diff --from <env> --to <env> <mode> [flags]
Exactly one mode is required: --full, --schema-only, or --bounded <duration>.

Flags

FlagDescription
--fromSource environment (required)
--toTarget environment (required)
--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 --project-dir examples/waffle_shop diff --from prod --to dev --full --select customer_status_snapshot

# Schema-only diff of all marts
sqb --project-dir examples/waffle_shop diff --from prod --to dev --schema-only --select path:marts

# Bounded diff of last 14 days
sqb --project-dir examples/waffle_shop diff --from prod --to 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.