You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| All models |`source_relation` column (when using a single Salesforce Marketing Cloud schema) | Empty string (`''`) |`<database>.<schema>`||
11
+
12
+
## Feature Updates
13
+
- Introduces the new (recommended) `salesforce_marketing_cloud_sources` variable for more robust union data configuration. The old `salesforce_marketing_cloud_union_schemas` and `salesforce_marketing_cloud_union_databases` variables will still be supported. See the [README](https://github.com/fivetran/dbt_salesforce_marketing_cloud/tree/main#define-database-and-schema-variables) for specific details.
14
+
15
+
## Under the Hood
16
+
- Adds the `fivetran_using_source_casing` variable for case-sensitive destination support. When enabled, downstream transformations respect source casing to ensure consistent results. See the [Additional Configurations](https://github.com/fivetran/dbt_salesforce_marketing_cloud/#source-casing-for-case-sensitive-destinations) section of the README for details.
17
+
- Introduces `fivetran_utils.partition_by_source_relation` to conditionally include `source_relation` in partition clauses only when multiple sources are configured.
18
+
1
19
# dbt_salesforce_marketing_cloud v0.5.1
2
20
3
21
[PR #16](https://github.com/fivetran/dbt_salesforce_marketing_cloud/pull/16) includes the following updates:
Copy file name to clipboardExpand all lines: README.md
+31-9Lines changed: 31 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ Include the following Salesforce Marketing Cloud package version in your `packag
75
75
```yml
76
76
packages:
77
77
- package: fivetran/salesforce_marketing_cloud
78
-
version: [">=0.5.0", "<0.6.0"] # we recommend using ranges to capture non-breaking changes automatically
78
+
version: [">=0.6.0", "<0.7.0"] # we recommend using ranges to capture non-breaking changes automatically
79
79
```
80
80
81
81
#### Databricks dispatch configuration
@@ -87,26 +87,40 @@ dispatch:
87
87
```
88
88
89
89
### Define database and schema variables
90
-
#### Single connection
90
+
#### Option A: Single connection
91
91
By default, this package runs using your destination and the `salesforce_marketing_cloud` schema. If this is not where your Salesforce Marketing Cloud data is (for example, if your Salesforce Marketing Cloud schema is named `salesforce_marketing_cloud_fivetran`), add the following configuration to your root `dbt_project.yml` file:
If you have multiple Salesforce Marketing Cloud connections in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the `source_relation` column of each model. To use this functionality, you will need to set either the `salesforce_marketing_cloud_union_schemas` OR `salesforce_marketing_cloud_union_databases` variables (cannot do both) in your root `dbt_project.yml` file:
98
+
99
+
#### Option B: Union multiple connections
100
+
If you have multiple Salesforce Marketing Cloud connections in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. For each source table, the package will union all of the data together and pass the unioned table into the transformations. The `source_relation` column in each model indicates the origin of each record.
101
+
102
+
To use this functionality, you will need to set the `salesforce_marketing_cloud_sources` variable in your root `dbt_project.yml` file:
100
103
101
104
```yml
105
+
# dbt_project.yml
106
+
102
107
vars:
103
-
salesforce_marketing_cloud_union_schemas: ['sfmc_usa','sfmc_canada'] # use this if the data is in different schemas/datasets of the same database/project
104
-
salesforce_marketing_cloud_union_databases: ['sfmc_usa','sfmc_canada'] # use this if the data is in different databases/projects but uses the same schema name
name: connection_1_source_name # Required only if following the step in the following subsection
113
+
114
+
- database: connection_2_destination_name
115
+
schema: connection_2_schema_name
116
+
name: connection_2_source_name
105
117
```
106
118
107
-
> NOTE: The native `source.yml` connection set up in the package will not function when the union schema/database feature is utilized. Although the data will be correctly combined, you will not observe the sources linked to the package models in the Directed Acyclic Graph (DAG). This happens because the package includes only one defined `source.yml`.
119
+
> Previous versions of this package employed two separate, mutually exclusive variables for unioning: `salesforce_marketing_cloud_union_schemas` and `salesforce_marketing_cloud_union_databases`. While these variables are still supported, `salesforce_marketing_cloud_sources` is the recommended variable to configure.
120
+
121
+
#### Optional: Incorporate unioned sources into DAG
108
122
109
-
To connect your multiple schema/database sources to the package models, follow the steps outlined in the [Union Data Defined Sources Configuration](https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source) section of the Fivetran Utils documentation for the union_data macro. This will ensure a proper configuration and correct visualization of connections in the DAG.
123
+
If you use [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt#transformationsfordbtcore) and are unioning multiple Salesforce Marketing Cloud connections, you can define your sources in a property `.yml` file, [using this as a template](https://github.com/fivetran/dbt_salesforce_marketing_cloud/blob/main/models/staging/src_salesforce_marketing_cloud.yml). Set the variable `has_defined_sources: true` under the Salesforce Marketing Cloud namespace in your `dbt_project.yml`. Otherwise, your Salesforce Marketing Cloud connections won't appear in your DAG. See the `union_connections` macro [documentation](https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#optional-union-connections-defined-sources-configuration) for full configuration details.
110
124
111
125
### Enable/Disable Variables
112
126
By default, this package brings in data from the Salesforce Marketing Cloud `link` and `list` source tables. However, if you have disabled syncing these sources, you will need to add the following configuration to your `dbt_project.yml`:
#### Source casing for case-sensitive destinations
159
+
By default, the package applies case-insensitive comparisons when resolving `source_relation` values. If your destination is case-sensitive and you want downstream transformations to respect the exact casing of your source database and schema names, set the following variable:
160
+
161
+
```yml
162
+
vars:
163
+
fivetran_using_source_casing: true
164
+
```
165
+
144
166
### (Optional) Orchestrate your models with Fivetran Transformations for dbt Core™
0 commit comments