strategy
- timestamp
- check
dbt_project.yml
snapshots:
  <resource-path>:
    +strategy: timestamp
    +updated_at: column_name
dbt_project.yml
snapshots:
  <resource-path>:
    +strategy: check
    +check_cols: [column_name] | all
Description
The snapshot strategy dbt should use to detect record changes. Read the guide to snapshots to understand the differences between the two.
Default
This is a required configuration. There is no default value.
Examples
Use the timestamp strategy
Use the check strategy
Advanced: define and use custom snapshot strategy
Behind the scenes, snapshot strategies are implemented as macros, named snapshot_<strategy>_strategy
- Source code for the timestamp strategy
- Source code for the check strategy
It's possible to implement your own snapshot strategy by adding a macro with the same naming pattern to your project. For example, you might choose to create a strategy which records hard deletes, named timestamp_with_deletes.
- Create a macro named snapshot_timestamp_with_deletes_strategy. Use the existing code as a guide and adjust as needed.
- Use this strategy via the strategyconfiguration:
0