Skip to main content
The sqb dbt commands use --select and --exclude to scope what runs. Selectors work across both dbt and SQLBuild, with the system determining which side owns each selector and how to route work.

SQLBuild-recognized selectors

These selectors match SQLBuild models directly: When a SQLBuild model is selected, its immediate dbt upstream dependencies are always included so dbt can build the tables that SQLBuild models read from.

dbt-only selectors

Selectors that SQLBuild does not recognize (like state:modified, package:stripe, source:stripe.charges) are passed to dbt ls to resolve: This means you can use dbt-native selectors like state:modified+ to trigger rebuilds of SQLBuild models that depend on changed dbt models. If dbt ls returns no matching models, no SQLBuild work is triggered.

Exclude

--exclude removes matching SQLBuild models from the final selection:

Examples

Execution order

For sqb dbt run and sqb dbt build:
  1. dbt runs - a single dbt run/build command executes with the user’s selectors merged with any additional dbt models required by selected SQLBuild models
  2. SQLBuild runs - selected SQLBuild models execute against the now-built dbt tables