sqb dbt diff compares the relations your dbt build produces against a production baseline, so you can confirm dev matches prod before you promote. It resolves the production-shaped relations the same way reuse does (by compiling your dbt project at a configured git ref), then compares each model.
Every run requires exactly one comparison mode:
Modes
--schema-only
Compares column names and types per model, without reading row data. Fast, needs no key, and works on any model:
--full
Compares rows. Full row comparison needs a key to align rows between the two sides, so each compared model must define config.unique_key in its dbt config:
unique_key to the model config to enable a full row diff, or fall back to --schema-only for models without a natural key.
--bounded
Compares only a recent window of rows instead of the whole table, using the model’s SQLBuild cursor metadata. This keeps the comparison cheap on large relations. The value depends on the cursor kind:
- Timestamp cursor: a duration like
30d,12h, or15m- compares the last N of time. - Integer cursor: an integer bound.
--bounded to apply; without it, SQLBuild reports a configuration error pointing you to add cursor metadata or use another mode.
On this topic
- Reuse from production - how the production baseline is resolved and reused.
- Clone - copy or clone production relations into a target.
- Testing - unit tests against dbt models.

