Skip to main content
Selectors let you scope commands to specific subsets of your project. They work with plan, build, test, audit, seed, clone, and diff.

Basic usage

--select (or -s for short) accepts one or more names. Multiple values are unioned. Space-separated names within one --select are also unioned. --exclude subtracts from the selected set. When no --select is provided, all models are selected.

Selector types

Name

Select a single model by name:

Tag

Select all models with a specific tag:

Path

Select all models under a directory path:
Any name containing / is treated as a path selector, so path:models/marts and a bare models/marts work the same way. Path selectors require an explicit root directory: models/, tasks/, assets/, checks/, or loaders/. Nested paths work too: models/staging/orders.

Seed and source

Graph expansion

Upstream

Select a model plus all its upstream dependencies:

Downstream

Select a model plus all its downstream dependents:

Bidirectional

Graph expansion works with all selector types:

Path-between selectors

Select all models on the shortest path between two nodes:
With endpoint expansion:
This selects:
  • All upstreams of fact_orders
  • Every model on the path between fact_orders and daily_activity_rollup
  • All downstreams of daily_activity_rollup
This is useful for rebuilding a specific slice of the DAG without manually listing every model in between.

Intersection

Use commas to intersect selector results:
This selects only models that match both conditions - in this case, models tagged staging that are also under the models/finance directory.

Combining select and exclude

Error handling

Unknown model names, empty paths, and malformed selectors produce clear error messages:
If a path selector omits the root directory, SQLBuild asks for the explicit form: