Skip to content

Commit

Permalink
Merge pull request #54 from fivetran/feature/materialization-var
Browse files Browse the repository at this point in the history
feature/materialization-var
  • Loading branch information
fivetran-joemarkiewicz authored Jun 23, 2022
2 parents 5278019 + af8fee3 commit 40cdfd4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# dbt_salesforce_formula_utils v0.6.5
## Features
- Inclusion of the `materialization` argument to the `sfdc_formula_view` macro. The argument is `view` by default. However, if a user wishes to override the materialization then they may do so with this argument.
# dbt_salesforce_formula_utils v0.6.4
## Under the Hood
- The string `__table` is now appended to the table alias to match with the data provided within the connector. To ensure consistency across the board, the `reserved_table_name` argument is now ignored in place of the `{{source_table}}__table` format. ([#51](https://github.com/fivetran/dbt_salesforce_formula_utils/pull/51))
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ This macro generates the final sql needed to join the Salesforce formula fields
* `source_table` (required): The table with which you are joining the formula fields.
* `source_name` (optional, default 'salesforce'): The dbt source containing the table you want to join with formula fields. Must also contain the `fivetran_formula` table.
* `fields_to_include` (optional, default is none): If a users wishes to only run the formula fields macro for designated fields then they may be applied within this variable. This variable will ensure the model only generates the sql for the designated fields.
* `materialization` (optional, default is `view`): By default the model will be materialized as a view. If you would like to materialize as a table, you can adjust using this argument.
> Note: If you populate the `fields_to_include` argument then the package will exclusively look for those fields. If you have designated a field to be excluded within the `sfdc_exclude_formulas` variable, then this will be ignored and the field will be included in the final model.
----

Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'salesforce_formula_utils'
version: '0.6.4'
version: '0.6.5'
config-version: 2

require-dbt-version: [">=1.0.0", "<2.0.0"]
2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

name: 'salesforce_formula_integration_tests'
version: '0.6.4'
version: '0.6.5'
profile: 'integration_tests'
config-version: 2

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

-- Best practice for this model is to be materialized as view. That is why we have set that here.
{{
config(
materialized = 'view'
materialized = materialization
)
}}

Expand Down

0 comments on commit 40cdfd4

Please sign in to comment.