Skip to main content

sqb freshness

Observes the current data version of each source and reports whether the data has changed since the last build. Does not write any state or trigger builds.

Usage

Flags

Source selection

Without --select, all sources in the project are observed. When --select is provided, selectors work like other commands: you can select sources by name, or select models and their upstream sources are automatically included:

Observation without state

By default, sqb freshness observes the current data version of each source and reports what it found. No comparison is made against previous observations:
Sources without explicit freshness: config are auto-observed using the adapter strategy if the adapter supports table metadata. Sources that can’t be observed (expression sources, managed sources without freshness config on unsupported adapters) show as unknown.

Comparing against state

Use --state to compare current observations against the freshness state stored from the last successful build:

Statuses

Virtual environment state

To compare against state stored in a virtual environment instead of standard mode state:

CI integration

Use --fail-on-error to fail the pipeline if any source can’t be observed:
Use --fail-on-stale with --state to fail if any source has new data that hasn’t been built yet:
This is useful for CI gates that should block if source data has changed but the pipeline hasn’t run yet.

JSON output

See also