Skip to main content

About dbt source command

(Applies to dbt v2.0 and later)

The dbt source command provides one legacy subcommand, dbt source freshness, which evaluates sources only.

In v2, use the top-level dbt freshness command to evaluate both sources and models against their configured freshness thresholds in a single command.

Freshness

(Applies to dbt v2.0 and later)

If your dbt project is configured with sources, dbt determines the "freshness" of each source table from the freshness config specified for that source. If a table is stale, dbt reports a warning or error accordingly and exits with a nonzero exit code.

To evaluate source freshness, run dbt freshness.

Configure freshness

The example below shows how to configure source freshness in dbt. Refer to Declaring source freshness for more information.

models/<filename>.yml


sources:
- name: jaffle_shop
database: raw