File: 201_basic_snapshot.sql

package info (click to toggle)
sqlfmt 0.29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,580 kB
  • sloc: python: 10,007; sql: 5,626; makefile: 39
file content (26 lines) | stat: -rw-r--r-- 655 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{% snapshot snp_my_snapshot %}
{{
    config(
          target_database='analytics',
          target_schema=target.schema+'_snapshots', unique_key='id',
          strategy='timestamp',
          updated_at='updated_at',
        )
}}

select * from {{ ref('stg_my_model') }}{% endsnapshot %}
)))))__SQLFMT_OUTPUT__(((((
{% snapshot snp_my_snapshot %}
    {{
        config(
            target_database="analytics",
            target_schema=target.schema + "_snapshots",
            unique_key="id",
            strategy="timestamp",
            updated_at="updated_at",
        )
    }}

    select *
    from {{ ref("stg_my_model") }}
{% endsnapshot %}