check_cols
snapshots/<filename>.sql
{{ config(
strategy="check",
check_cols=["column_name"]
) }}
dbt_project.yml
snapshots:
<resource-path>:
+strategy: check
+check_cols: [column_name] | all
Description
A list of columns within the results of your snapshot query to check for changes.
Alternatively, use all columns using the all
value (however this may be less performant).
This parameter is required if using the check
strategy.
Default
No default is provided.
Examples
Check a list of columns for changes
{% snapshot orders_snapshot_check %}
{{
config(
strategy='check',
unique_key='id',
check_cols=['status', 'is_cancelled'],
)
}}
select * from {{ source('jaffle_shop', 'orders') }}
{% endsnapshot %}
Check all columns for changes
{% snapshot orders_snapshot_check %}
{{
config(
strategy='check',
unique_key='id',
check_cols='all',
)
}}
select * from {{ source('jaffle_shop', 'orders') }}
{% endsnapshot %}
0