Materialize a snapshot

PHOTO EMBED

Sat May 06 2023 15:30:45 GMT+0000 (Coordinated Universal Time)

Saved by @klleee28 #dbt #materialize

{% snapshot mock_orders %}

{% set new_schema = target.schema + '_snapshot' %}

{{
    config(
        target_database='analytics',
        target_schema=new_schema,
        unique_key='order_id',

        strategy='timestamp',
        updated_at='updated_at'
    )
}}

select * from analytics.{{ target.schema }}.mock_orders

{% endsnapshot %}
content_copyCOPY

.sql file to be created under snapshot folder.