Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20240927-133708.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Enable setting current value of dbt_valid_to
time: 2024-09-27T13:37:08.808843-04:00
custom:
Author: gshank
Issue: "151"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
from {{ source }} as DBT_INTERNAL_SOURCE
where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text
and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)
and {{ target }}.{{ columns.dbt_valid_to }} is null;
{% if config.get("dbt_valid_to_current") %}
and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);
{% else %}
and {{ target }}.{{ columns.dbt_valid_to }} is null;
{% endif %}


insert into {{ target }} ({{ insert_cols_csv }})
select {% for column in insert_cols -%}
Expand Down