Skip to content

feat: default sqb diff to the active target and a size-guarded full comparison - #976

Merged
kvlonge merged 1 commit into
mainfrom
feat/diff-defaults
Oct 6, 2026
Merged

kvlonge merged 1 commit into
mainfrom
feat/diff-defaults

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Why

Model-mode sqb diff required a FROM:TO range and exactly one of --full, --schema-only or --bounded, and --key / --exclude-column had to be repeated for each value.

Changes

  • sqb diff prod -s x compares prod with the active target, as sqb clone --from does; FROM:TO keeps working.
  • With no mode flag, diff runs a full comparison after a size guard: row counts come from warehouse metadata on both sides, and any model over its side's limit, or of unknown size (views, missing metadata), stops the run before data is read, with the sizes and the commands to run instead. Explicit --full, --bounded and --schema-only bypass the guard.
  • New [targets.<name>.diff] max_full_rows (positive integer or "unlimited", default 10,000,000), overridable in sqlbuild_local.toml.
  • Row-count lookup on every built-in adapter; custom adapters report unknown by default.
  • --key and --exclude-column take several values.
  • Docs for cli/diff, concepts/diff and project configuration.

Verification

  • Unit tests for config parsing, limits, error rendering, FROM/TO parsing and offline adapter lookups; DuckDB integration tests for the guard (under, over either side, unknown, unlimited, metadata-only queries before stopping); 12 new E2E cases.
  • Focused pytest, ruff, fensu check and make check-ci.

…omparison

A bare FROM compares with the active target. Without a mode flag, model diffs run a full comparison only after each table's metadata row count is within the per-target [targets.<name>.diff] max_full_rows limit (10,000,000 by default, or "unlimited"). Adapters report row counts through estimate_relation_row_count. --key and --exclude-column now take several values.
@kvlonge
kvlonge enabled auto-merge (squash) October 6, 2026 13:36
@kvlonge
kvlonge merged commit 92cb04e into main Oct 6, 2026
32 checks passed
@kvlonge
kvlonge deleted the feat/diff-defaults branch October 6, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant