add macro to restrict materializations for INSERT models

This commit is contained in:
Dave Connors
2023-02-20 16:46:56 -06:00
parent e26dbb44ba
commit 361420eb08
8 changed files with 14 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
{%- macro check_model_is_table(model) -%}
{%- if model.config.materialized != 'table' -%}
{%- do exceptions.raise_compiler_error(
"Model must use the table materialization. Please check any model overrides."
) -%}
{%- endif -%}
{%- endmacro -%}

View File

@@ -5,6 +5,7 @@
)
}}
{{ check_model_is_table(model) }}
/* Bigquery won't let us `where` without `from` so we use this workaround */
with dummy_cte as (
select 1 as foo

View File

@@ -5,6 +5,7 @@
)
}}
{{ check_model_is_table(model) }}
/* Bigquery won't let us `where` without `from` so we use this workaround */
with dummy_cte as (
select 1 as foo

View File

@@ -5,6 +5,7 @@
)
}}
{{ check_model_is_table(model) }}
/* Bigquery won't let us `where` without `from` so we use this workaround */
with dummy_cte as (
select 1 as foo

View File

@@ -5,6 +5,7 @@
)
}}
{{ check_model_is_table(model) }}
/* Bigquery won't let us `where` without `from` so we use this workaround */
with dummy_cte as (
select 1 as foo

View File

@@ -5,6 +5,7 @@
)
}}
{{ check_model_is_table(model) }}
/* Bigquery won't let us `where` without `from` so we use this workaround */
with dummy_cte as (
select 1 as foo

View File

@@ -5,6 +5,7 @@
)
}}
{{ check_model_is_table(model) }}
/* Bigquery won't let us `where` without `from` so we use this workaround */
with dummy_cte as (
select 1 as foo

View File

@@ -5,7 +5,7 @@
)
}}
{{ check_model_is_table(model) }}
/* Bigquery won't let us `where` without `from` so we use this workaround */
with dummy_cte as (
select 1 as foo