Skip to content
Open
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
4 changes: 2 additions & 2 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ models:
+full_refresh: false
+persist_docs:
# Databricks and SQL Server don't offer column-level support for persisting docs
columns: '{{ target.name != "databricks" and target.type != "sqlserver" }}'
relation: '{{ target.type != "sqlserver" }}'
columns: '{{ target.name != "databricks" and target.type != "sqlserver" and target.type != "synapse" and target.type != "fabric" }}'
relation: '{{ target.type != "sqlserver" and target.type != "synapse" and target.type != "fabric" }}'
+as_columnstore: False
2 changes: 1 addition & 1 deletion integration_test_project/seeds/seeds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ seeds:
config:
column_types:
id: integer
load_timestamp: "{{ 'datetime2' if target.type == 'sqlserver' else 'timestamp' }}"
load_timestamp: "{{ 'datetime2' if target.type == 'sqlserver' or target.type == 'synapse' or target.type == 'fabric' else 'timestamp' }}"
8 changes: 8 additions & 0 deletions macros/database_specific_helpers/type_helpers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
json
{% endmacro %}

{% macro fabric__type_json() %}
varchar(max)
{% endmacro %}

{#- ARRAY -#}

{% macro type_array() %}
Expand All @@ -48,6 +52,10 @@
array(varchar)
{% endmacro %}

{% macro fabric__type_array() %}
varchar(max)
{% endmacro %}

{#- NUMERIC -#}%}

{% macro type_numeric() %}
Expand Down
8 changes: 8 additions & 0 deletions macros/integration_tests/safe_cast.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
'string': {
'postgres': 'TEXT',
'sqlserver': 'VARCHAR',
'synapse': 'VARCHAR',
'fabric': 'VARCHAR',
'bigquery': 'STRING',
'snowflake': 'VARCHAR',
'databricks': 'STRING',
Expand All @@ -13,6 +15,8 @@
'integer': {
'postgres': 'NUMERIC',
'sqlserver': 'FLOAT',
'synapse': 'FLOAT',
'fabric': 'FLOAT',
'bigquery': 'FLOAT64',
'snowflake': 'FLOAT',
'databricks': 'DOUBLE',
Expand All @@ -21,6 +25,8 @@
'date': {
'postgres': 'DATE',
'sqlserver': 'DATE',
'synapse': 'DATE',
'fabric': 'DATE',
'bigquery': 'DATE',
'snowflake': 'DATE',
'databricks': 'DATE',
Expand All @@ -29,6 +35,8 @@
'timestamp': {
'postgres': 'TIMESTAMP',
'sqlserver': 'DATETIME2',
'synapse': 'DATETIME2',
'fabric': 'DATETIME2',
'bigquery': 'TIMESTAMP',
'snowflake': 'TIMESTAMP',
'databricks': 'TIMESTAMP',
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_individual_datasets/upload_exposures.sql
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
{% endif %}
{%- endmacro %}

{% macro sqlserver__get_exposures_dml_sql(exposures) -%}
{% macro fabric__get_exposures_dml_sql(exposures) -%}
Comment thread
sdebruyn marked this conversation as resolved.

{% if exposures != [] %}
{% set exposure_values %}
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_individual_datasets/upload_invocations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
{% endmacro -%}


{% macro sqlserver__get_invocations_dml_sql(invocation_args=invocation_args_dict) -%}
{% macro fabric__get_invocations_dml_sql(invocation_args=invocation_args_dict) -%}
{% set invocation_values %}
select
"1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
{%- endmacro %}


{% macro sqlserver__get_model_executions_dml_sql(models) -%}
{% macro fabric__get_model_executions_dml_sql(models) -%}
Comment thread
sdebruyn marked this conversation as resolved.
{% if models != [] %}
{% set model_execution_values %}
select
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_individual_datasets/upload_models.sql
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
{%- endmacro %}


{% macro sqlserver__get_models_dml_sql(models) -%}
{% macro fabric__get_models_dml_sql(models) -%}
Comment thread
sdebruyn marked this conversation as resolved.

{% if models != [] %}
{% set model_values %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
{% endif %}
{% endmacro -%}

{% macro sqlserver__get_seed_executions_dml_sql(seeds) -%}
{% macro fabric__get_seed_executions_dml_sql(seeds) -%}
Comment thread
sdebruyn marked this conversation as resolved.
{% if seeds != [] %}
{% set seed_execution_values %}
select
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_individual_datasets/upload_seeds.sql
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
{% endif %}
{%- endmacro %}

{% macro sqlserver__get_seeds_dml_sql(seeds) -%}
{% macro fabric__get_seeds_dml_sql(seeds) -%}
Comment thread
sdebruyn marked this conversation as resolved.

{% if seeds != [] %}
{% set seed_values %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
{% endif %}
{% endmacro -%}

{% macro sqlserver__get_snapshot_executions_dml_sql(snapshots) -%}
{% macro fabric__get_snapshot_executions_dml_sql(snapshots) -%}
Comment thread
sdebruyn marked this conversation as resolved.
{% if snapshots != [] %}
{% set snapshot_execution_values %}
select
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_individual_datasets/upload_snapshots.sql
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
{%- endmacro %}


{% macro sqlserver__get_snapshots_dml_sql(snapshots) -%}
{% macro fabric__get_snapshots_dml_sql(snapshots) -%}
Comment thread
sdebruyn marked this conversation as resolved.

{% if snapshots != [] %}
{% set snapshot_values %}
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_individual_datasets/upload_sources.sql
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
{%- endmacro %}


{% macro sqlserver__get_sources_dml_sql(sources) -%}
{% macro fabric__get_sources_dml_sql(sources) -%}
Comment thread
sdebruyn marked this conversation as resolved.

{% if sources != [] %}
{% set source_values %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
{% endif %}
{% endmacro -%}

{% macro sqlserver__get_test_executions_dml_sql(tests) -%}
{% macro fabric__get_test_executions_dml_sql(tests) -%}
Comment thread
sdebruyn marked this conversation as resolved.
{% if tests != [] %}
{% set test_execution_values %}
select
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_individual_datasets/upload_tests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
{%- endmacro %}


{% macro sqlserver__get_tests_dml_sql(tests) -%}
{% macro fabric__get_tests_dml_sql(tests) -%}
Comment thread
sdebruyn marked this conversation as resolved.

{% if tests != [] %}
{% set test_values %}
Expand Down
14 changes: 7 additions & 7 deletions macros/upload_results/get_column_name_lists.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
{% if target.type == "bigquery" %} bytes_processed,
{% endif %}
materialization,
{% if target.type == "sqlserver" %} "schema",
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema",
{% else %} schema,
{% endif %}
name,
Expand All @@ -78,7 +78,7 @@
command_invocation_id,
node_id,
run_started_at,
{% if target.type == "sqlserver" %} "database", "schema",
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "database", "schema",
{% else %} database, schema,
{% endif %}
name,
Expand Down Expand Up @@ -107,7 +107,7 @@
total_node_runtime,
rows_affected,
materialization,
{% if target.type == "sqlserver" %} "schema",
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema",
{% else %} schema,
{% endif %}
name,
Expand All @@ -122,7 +122,7 @@
command_invocation_id,
node_id,
run_started_at,
{% if target.type == "sqlserver" %} "database", "schema",
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "database", "schema",
{% else %} database, schema,
{% endif %}
name,
Expand All @@ -148,7 +148,7 @@
total_node_runtime,
rows_affected,
materialization,
{% if target.type == "sqlserver" %} "schema",
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema",
{% else %} schema,
{% endif %}
name,
Expand All @@ -163,7 +163,7 @@
command_invocation_id,
node_id,
run_started_at,
{% if target.type == "sqlserver" %} "database", "schema",
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "database", "schema",
{% else %} database, schema,
{% endif %}
name,
Expand All @@ -183,7 +183,7 @@
command_invocation_id,
node_id,
run_started_at,
{% if target.type == "sqlserver" %} "database", "schema",
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "database", "schema",
{% else %} database, schema,
{% endif %}
source_name,
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_results/insert_into_metadata_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

{%- endmacro %}

{% macro sqlserver__insert_into_metadata_table(relation, fields, content) -%}
{% macro fabric__insert_into_metadata_table(relation, fields, content) -%}
Comment thread
sdebruyn marked this conversation as resolved.

{% set insert_into_table_query %}
insert into {{ relation }} {{ fields }}
Expand Down
12 changes: 6 additions & 6 deletions models/dim_dbt__current_models.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ with
node_id,
max(
case
when was_full_refresh {% if target.type == "sqlserver" %} = 1 {% endif %}
when was_full_refresh {% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} = 1 {% endif %}
then query_completed_at
end
) as last_full_refresh_run_completed_at,
max(
case
when was_full_refresh {% if target.type == "sqlserver" %} = 1 {% endif %}
when was_full_refresh {% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} = 1 {% endif %}
then total_node_runtime
end
) as last_full_refresh_run_total_runtime,
max(
case
when was_full_refresh {% if target.type == "sqlserver" %} = 1 {% endif %}
when was_full_refresh {% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} = 1 {% endif %}
then rows_affected
end
) as last_full_refresh_run_rows_affected
Expand All @@ -75,19 +75,19 @@ with
{% endif %},
max(
case
when not was_full_refresh {% if target.type == "sqlserver" %} = 1 {% endif %}
when not was_full_refresh {% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} = 1 {% endif %}
then query_completed_at
end
) as last_incremental_run_completed_at,
max(
case
when not was_full_refresh {% if target.type == "sqlserver" %} = 1 {% endif %}
when not was_full_refresh {% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} = 1 {% endif %}
then total_node_runtime
end
) as last_incremental_run_total_runtime,
max(
case
when not was_full_refresh {% if target.type == "sqlserver" %} = 1 {% endif %}
when not was_full_refresh {% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} = 1 {% endif %}
then rows_affected
end
) as last_incremental_run_rows_affected
Expand Down
4 changes: 2 additions & 2 deletions models/dim_dbt__models.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ with
node_id,
run_started_at,
name,
{% if target.type == "sqlserver" %} "database"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "database"
{% else %} database
{% endif %},
{% if target.type == "sqlserver" %} "schema"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema"
{% else %} schema
{% endif %},
depends_on_nodes,
Expand Down
4 changes: 2 additions & 2 deletions models/dim_dbt__seeds.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ with
node_id,
run_started_at,
name,
{% if target.type == "sqlserver" %} "database"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "database"
{% else %} database
{% endif %},
{% if target.type == "sqlserver" %} "schema"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema"
{% else %} schema
{% endif %},
package_name,
Expand Down
4 changes: 2 additions & 2 deletions models/dim_dbt__snapshots.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ with
node_id,
run_started_at,
name,
{% if target.type == "sqlserver" %} "database"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "database"
{% else %} database
{% endif %},
{% if target.type == "sqlserver" %} "schema"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema"
{% else %} schema
{% endif %},
depends_on_nodes,
Expand Down
4 changes: 2 additions & 2 deletions models/dim_dbt__sources.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ with
command_invocation_id,
node_id,
run_started_at,
{% if target.type == "sqlserver" %} "database"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "database"
{% else %} database
{% endif %},
{% if target.type == "sqlserver" %} "schema"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema"
{% else %} schema
{% endif %},
source_name,
Expand Down
2 changes: 1 addition & 1 deletion models/fct_dbt__model_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ with
rows_affected
{% if target.type == "bigquery" %}, bytes_processed {% endif %},
materialization,
{% if target.type == "sqlserver" %} "schema"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema"
{% else %} schema
{% endif %},
name,
Expand Down
2 changes: 1 addition & 1 deletion models/fct_dbt__seed_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ with
total_node_runtime,
rows_affected,
materialization,
{% if target.type == "sqlserver" %} "schema"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema"
{% else %} schema
{% endif %},
name,
Expand Down
2 changes: 1 addition & 1 deletion models/fct_dbt__snapshot_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ with
total_node_runtime,
rows_affected,
materialization,
{% if target.type == "sqlserver" %} "schema"
{% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema"
{% else %} schema
{% endif %},
name,
Expand Down
2 changes: 1 addition & 1 deletion models/sources/model_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ select
cast(null as {{ type_int() }}) as bytes_processed,
{% endif %}
cast(null as {{ type_string() }}) as materialization,
cast(null as {{ type_string() }}) as {% if target.type == "sqlserver" %} "schema"
cast(null as {{ type_string() }}) as {% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema"
{% else %} schema
{% endif %},
cast(null as {{ type_string() }}) as name,
Expand Down
4 changes: 2 additions & 2 deletions models/sources/models.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ select
cast(null as {{ type_string() }}) as command_invocation_id,
cast(null as {{ type_string() }}) as node_id,
cast(null as {{ type_timestamp() }}) as run_started_at,
cast(null as {{ type_string() }}) as {% if target.type == "sqlserver" %} "database"
cast(null as {{ type_string() }}) as {% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "database"
{% else %} database
{% endif %},
cast(null as {{ type_string() }}) as {% if target.type == "sqlserver" %} "schema"
cast(null as {{ type_string() }}) as {% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema"
{% else %} schema
{% endif %},
cast(null as {{ type_string() }}) as name,
Expand Down
2 changes: 1 addition & 1 deletion models/sources/seed_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ select
cast(null as {{ type_float() }}) as total_node_runtime,
cast(null as {{ type_int() }}) as rows_affected,
cast(null as {{ type_string() }}) as materialization,
cast(null as {{ type_string() }}) as {% if target.type == "sqlserver" %} "schema"
cast(null as {{ type_string() }}) as {% if target.type == "sqlserver" or target.type == "synapse" or target.type == "fabric" %} "schema"
{% else %} schema
{% endif %},
cast(null as {{ type_string() }}) as name,
Expand Down
Loading