forked from dbt-labs/docs.getdbt.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation for snapshotting hard deleted records.
Gos with PR dbt-labs/dbt-core#2749
- Loading branch information
1 parent
57cb993
commit b4e7188
Showing
4 changed files
with
95 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
website/docs/reference/resource-configs/invalidate_hard_deletes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
resource_types: [snapshots] | ||
datatype: column_name | ||
--- | ||
<File name='snapshots/<filename>.sql'> | ||
|
||
```jinja2 | ||
{{ | ||
config( | ||
strategy="timestamp", | ||
invalidate_hard_deletes=True | ||
) | ||
}} | ||
``` | ||
|
||
</File> | ||
|
||
<File name='dbt_project.yml'> | ||
|
||
```yml | ||
snapshots: | ||
[<resource-path>](resource-path): | ||
+strategy: timestamp | ||
+invalidate_hard_deletes: true | ||
|
||
``` | ||
|
||
</File> | ||
|
||
## Description | ||
Opt-in feature to enable invalidating hard deleted records while snapshotting the query. | ||
|
||
|
||
## Default | ||
By default the feature is disabled. | ||
|
||
## Example | ||
|
||
<File name='snapshots/orders.sql'> | ||
|
||
```sql | ||
{% snapshot orders_snapshot %} | ||
|
||
{{ | ||
config( | ||
target_schema='snapshots', | ||
strategy='timestamp', | ||
unique_key='id', | ||
updated_at='updated_at', | ||
invalidate_hard_deletes=True, | ||
) | ||
}} | ||
|
||
select * from {{ source('jaffle_shop', 'orders') }} | ||
|
||
{% endsnapshot %} | ||
``` | ||
|
||
</File> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters