dbt source freshness for a specific database
Hey, trying to check the freshness of the source but not sure how to select the target database.
I’m running this first
dbt source freshness --select source:DATABASENAME
as I have other sources in yml file and then
dbt run --target first
but during the freshness check dbt randomly selects the target database.
Does anyone know how to solve it?
Can I use --target
together with dbt source freshness
command?
This is my code
sources:
- name: DATABASENAME
schema: STAGE
database: |
{%- if target.name == "first" -%} STAGING_FIRST
{%- elif target.name == "second" -%} STAGING_SECOND
{%- endif -%}
freshness: # default freshness
warn_after: {count: 12, period: hour}
error_after: {count: 24, period: hour}
loaded_at_field: insert_date
tables:
- name: orders
freshness:
warn_after: {count: 6, period: hour}
error_after: {count: 12, period: hour}