Skip to content

feat(config): select default warehouses per command group - #941

Merged
kvlonge merged 1 commit into
mainfrom
feat/command-group-warehouses
Oct 4, 2026
Merged

kvlonge merged 1 commit into
mainfrom
feat/command-group-warehouses

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Why

A target has one warehouse for every command, so ad-hoc query/diff calls wake the large build warehouse and pay its minimum resume time, while builds and plans can't use a bigger one without per-invocation edits or duplicate targets (CHI-483).

Changes

  • New [targets.<name>.warehouses] build / query in sqlbuild_project.toml and sqlbuild_local.toml, plus --warehouse on every grouped command. Precedence: flag > group > connection warehouse > user default. A group overrides a connection warehouse set in a local file.
  • One command-to-group table (build: audit, build, check, clone, dbt, janitor, load, plan, scenario, seed, test; query: contract, cost, debug, diff, freshness, query), enforced by a test. One warehouse per invocation for SQLBuild-owned work.
  • Adapters opt in with supports_session_warehouse (Snowflake and its subclasses). Shared groups are skipped when a local adapter override lacks it; otherwise misuse is an error. Names are validated as Snowflake identifiers (C260/C261).
  • sqb debug shows each group's warehouse and source.

Verification

  • Unit and real-CLI integration tests (offline Snowflake double) for build, plan, query, diff, precedence, local overrides, adapters, identifiers and debug.
  • One independent review plus follow-up; make test, make check-ci.

Snowflake targets can set [targets.<name>.warehouses] build and query
warehouses, overridable per invocation with --warehouse. Every CLI
command is classified into the build or query group in one table, so a
command never mixes warehouses. sqb debug and the verbose build header
report the resolved warehouse and its source. Adapters without a session
warehouse reject the settings.
@kvlonge
kvlonge enabled auto-merge (squash) October 4, 2026 11:26
@kvlonge
kvlonge merged commit e0d0706 into main Oct 4, 2026
32 checks passed
@kvlonge
kvlonge deleted the feat/command-group-warehouses branch October 4, 2026 12:05
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