Skip to content

Commit

Permalink
for testing: dbt-postgres 'microbatch' strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Sep 6, 2024
1 parent 5575fa8 commit 5c9086a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dbt/adapters/postgres/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def valid_incremental_strategies(self):
"""The set of standard builtin strategies which this adapter supports out-of-the-box.
Not used to validate custom strategies defined by end users.
"""
return ["append", "delete+insert", "merge"]
return ["append", "delete+insert", "merge", "microbatch"]

def debug_query(self):
self.execute("select 1 as id")
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,14 @@
{% endif %}

{% endmacro %}


{% macro get_incremental_microbatch_sql(arg_dict) %}

{% if arg_dict["unique_key"] %}
{% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}
{% else %}
{{ exceptions.raise_compiler_error("dbt-postgres 'microbatch' requires a `unique_key` config") }}
{% endif %}

{% endmacro %}

0 comments on commit 5c9086a

Please sign in to comment.