A dbt package that builds a Data Vault 2.0 model of your Salesforce data. It takes the raw Salesforce tables delivered by the
Fivetran Salesforce connector,
turns them into a raw vault (hubs, links, satellites) using Scalefree's
datavault4dbt macros, and then
exposes analytics-ready delivery models on top.
Currently supported platforms are all databases that the Fivetran Salesforce Connector can write to and datavault4dbt supports.
The models are organized into three layers:
| Folder | Layer | What it does |
|---|---|---|
models/01_stage |
Staging | Wraps the Fivetranstg_salesforce__* models and computes hash keys / hashdiffs. |
models/02_raw_vault |
Raw Vault | The Data Vault: hubs, links and satellites. |
models/03_information_delivery |
Information Delivery | Analytics-ready views on top of the data vault (e.g.salesforce__opportunity_enhanced, salesforce__owner_performance, salesforce__daily_activity, salesforce__sales_snapshot). |
Account, Contact, Event, Lead, Opportunity, Opportunity Line Item, Order, Product, Task, User and User Role.
The diagram below shows the resulting raw vault — hubs, links and satellites per entity. It was drawn with Visual Data Vault, Scalefree's browser-based editor for Data Vault diagrams. Click the image for the full-resolution version.
_h= hub,_l= link,_hl= hierarchical link.- Satellites come in two flavours:
v0= raw, fully historized satellite;v1= current-record view.n= business (non-PII) attributes;p= personal (PII) attributes.
- dbt (tested with dbt-core 1.11 / dbt-bigquery 1.11).
- Salesforce data landed by the Fivetran Salesforce connector.
Declared in packages.yml:
| Package | Role |
|---|---|
dbt-labs/dbt_utils |
Utility macros / tests. |
ScalefreeCOM/datavault4dbt |
Data Vault macros. |
fivetran/salesforce |
Upstream Salesforce staging models. |
- Install dependencies:
dbt deps
- Configure a profile named
dbt_salesforce_analytics_vaultin yourprofiles.yml. - Point the
fivetran/salesforcepackage at the dataset(s) where Fivetran lands your Salesforce tables (see that package's documentation for its variables). - Build the models:
dbt build
This package ships its Data Vault metadata as a
turbovault-engine JSON export:
docs/dbt_salesforce_analytics_vault_export.json.
turbovault-engine is Scalefree's CLI-first generator that turns source metadata into a
production-ready datavault4dbt project; it accepts its own JSON exports as input, so the model
can be re-imported, inspected, extended and regenerated:
- Install the engine:
pip install turbovault-engine
- Initialize a workspace (once per directory):
turbovault workspace init
- Import this package's export as a project (run from the package root so the relative path resolves):
turbovault project init --name salesforce_dv \ --source docs/dbt_salesforce_analytics_vault_export.json
- Inspect and edit sources, stages, hubs, links and satellites in the web UI:
turbovault serve
- Regenerate dbt models after changes:
turbovault generate --project salesforce_dv --output ./generated
See the turbovault-engine README for all options, and Scalefree's TurboVault page for background.
