mirror of
https://github.com/dbt-labs/dbt-project-evaluator.git
synced 2025-12-18 02:11:27 +00:00
add macro to restrict materializations for INSERT models
This commit is contained in:
7
macros/check_model_is_table.sql
Normal file
7
macros/check_model_is_table.sql
Normal 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 -%}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user