diff --git a/integration_tests/macros/operations/create_source_table.sql b/integration_tests/macros/operations/create_source_table.sql index 6794e51..8123f33 100644 --- a/integration_tests/macros/operations/create_source_table.sql +++ b/integration_tests/macros/operations/create_source_table.sql @@ -48,8 +48,8 @@ set enable_case_sensitive_identifier to true; {% set create_table_sql_case_sensitive %} create table {{ target_schema }}.codegen_integration_tests__data_source_table_case_sensitive as ( select - 1 as {% if target.type == "bigquery" %}My_Integer_Col{% else %}"My_Integer_Col"{% endif %}, - true as {% if target.type == "bigquery" %}My_Bool_Col{% else %}"My_Bool_Col"{% endif %} + 1 as {{ adapter.quote("My_Integer_Col") }}, + true as {{ adapter.quote("My_Bool_Col") }} ) {% endset %} diff --git a/integration_tests/tests/test_generate_base_models_all_args.sql b/integration_tests/tests/test_generate_base_models_all_args.sql index 5a0b21e..89497de 100644 --- a/integration_tests/tests/test_generate_base_models_all_args.sql +++ b/integration_tests/tests/test_generate_base_models_all_args.sql @@ -20,8 +20,8 @@ with source as ( renamed as ( select - {% if target.type == "bigquery" %}My_Integer_Col{% else %}"My_Integer_Col"{% endif %} - , {% if target.type == "bigquery" %}My_Bool_Col{% else %}"My_Bool_Col"{% endif %} + {{ adapter.quote("My_Integer_Col") }} + , {{ adapter.quote("My_Bool_Col") }} from source diff --git a/integration_tests/tests/test_generate_base_models_case_sensitive.sql b/integration_tests/tests/test_generate_base_models_case_sensitive.sql index 2fd3123..1f18a1c 100644 --- a/integration_tests/tests/test_generate_base_models_case_sensitive.sql +++ b/integration_tests/tests/test_generate_base_models_case_sensitive.sql @@ -16,8 +16,8 @@ with source as ( renamed as ( select - {% if target.type == "bigquery" %}My_Integer_Col{% else %}"My_Integer_Col"{% endif %}, - {% if target.type == "bigquery" %}My_Bool_Col{% else %}"My_Bool_Col"{% endif %} + {{ adapter.quote("My_Integer_Col") }}, + {{ adapter.quote("My_Bool_Col") }} from source diff --git a/macros/generate_base_model.sql b/macros/generate_base_model.sql index 0a58784..aa74145 100644 --- a/macros/generate_base_model.sql +++ b/macros/generate_base_model.sql @@ -25,11 +25,11 @@ renamed as ( select {%- if leading_commas -%} {%- for column in column_names %} - {{", " if not loop.first}}{% if not case_sensitive_cols %}{{ column | lower }}{% elif target.type == "bigquery" %}{{ column }}{% else %}{{ "\"" ~ column ~ "\"" }}{% endif %} + {{", " if not loop.first}}{% if not case_sensitive_cols %}{{ column | lower }}{% else %}{{ adapter.quote(column) }}{% endif %} {%- endfor %} {%- else -%} {%- for column in column_names %} - {% if not case_sensitive_cols %}{{ column | lower }}{% elif target.type == "bigquery" %}{{ column }}{% else %}{{ "\"" ~ column ~ "\"" }}{% endif %}{{"," if not loop.last}} + {% if not case_sensitive_cols %}{{ column | lower }}{% else %}{{ adapter.quote(column) }}{% endif %}{{"," if not loop.last}} {%- endfor -%} {%- endif %}