Skip to content

Commit

Permalink
Merge branch 'releases/v0.7.latest' into feature/update-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-jamie authored Feb 16, 2023
2 parents 4724620 + 722b7f4 commit e848df2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
## Features
- Updated the README for easier use and navigation of the package ([PR #78](https://github.com/fivetran/dbt_salesforce_formula_utils/pull/78)).

## Bug Fixes
([PR #77](https://github.com/fivetran/dbt_salesforce_formula_utils/pull/77)) includes the following changes:
- In v0.8.0, the `using_quoted_identifiers` argument in the `sfdc_formula_view()` macro was erroneously removed, making its default value of `False` immutable. It has been reintroduced.
- `using_quoted_identifiers` now uses warehouse-specific quoting syntax.

# dbt_salesforce_formula_utils v0.8.0

## 🚨 Breaking Changes 🚨:
Expand Down
6 changes: 4 additions & 2 deletions macros/sfdc_formula_view.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- macro sfdc_formula_view(source_table, source_name='salesforce', reserved_table_name=source_table, fields_to_include=none, full_statement_version=true, materialization='view') -%}
{%- macro sfdc_formula_view(source_table, source_name='salesforce', reserved_table_name=source_table, fields_to_include=none, full_statement_version=true, materialization='view', using_quoted_identifiers=False) -%}

-- Best practice for this model is to be materialized as view. That is why we have set that here.
{{
Expand All @@ -15,7 +15,9 @@

{% if full_statement_version %}
{% if using_quoted_identifiers %}
{%- set table_results = dbt_utils.get_column_values(table=source(source_name, 'fivetran_formula_model'), column='"model"', where="\"object\" = '" ~ source_table ~ "'") -%}
{%- set table_results = dbt_utils.get_column_values(table=source(source_name, 'fivetran_formula_model'),
column='"MODEL"' if target.type in ('snowflake') else '"model"' if target.type in ('postgres', 'redshift', 'snowflake') else '`model`',
where=("\"OBJECT\" = '" if target.type in ('snowflake') else "\"object\" = '" if target.type in ('postgres', 'redshift') else "`object` = '") ~ source_table ~ "'") -%}

{% else %}
{%- set table_results = dbt_utils.get_column_values(table=source(source_name, 'fivetran_formula_model'), column='model', where="object = '" ~ source_table ~ "'") -%}
Expand Down

0 comments on commit e848df2

Please sign in to comment.