Skip to content

Commit

Permalink
Merge pull request #10 from Yaruis19/add-pass-through-columns-for-cus…
Browse files Browse the repository at this point in the history
…tomers

add pass through for customers
  • Loading branch information
fivetran-joemarkiewicz authored Oct 28, 2021
2 parents 132be8c + 19a89e8 commit a8280b4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ vars:
departments_pass_through_columns: ['department_custom_fields']
transactions_pass_through_columns: ['transactions_can_be_custom','pass_this_transaction_field_on']
transaction_lines_pass_through_columns: ['transaction_lines_field']
customers_pass_through_columns: ['customers_field']
```

### Changing the Build Schema
Expand Down
7 changes: 4 additions & 3 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config-version: 2
require-dbt-version: ">=0.20.0"

name: 'netsuite_source'
version: '0.3.2'

Expand Down Expand Up @@ -36,7 +36,8 @@ vars:
departments_pass_through_columns: []
transactions_pass_through_columns: []
transaction_lines_pass_through_columns: []

customers_pass_through_columns: []

clean-targets:
- target
- dbt_modules
- dbt_modules
15 changes: 15 additions & 0 deletions models/stg_netsuite__customers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ fields as (
)
}}

--The below script allows for pass through columns.
{% if var('customers_pass_through_columns') %}
,
{{ var('customers_pass_through_columns') | join (", ")}}

{% endif %}

from base
),

Expand All @@ -39,6 +46,14 @@ final as (
date_first_order as date_first_order_at,
_fivetran_deleted

--The below script allows for pass through columns.
{% if var('customers_pass_through_columns') %}
,
{{ var('customers_pass_through_columns') | join (", ")}}

{% endif %}


from fields
)

Expand Down

0 comments on commit a8280b4

Please sign in to comment.