This is a sample dbt Core project for Fivetran users– it can be cloned and modified to help you get up and running with Fivetran Transformations for dbt Core™.
While this repository can be connected into Fivetran as-is, we recommend that you install an IDE and dbt Core locally to develop your production models. More information on setting up your local environment can be found in the dbt Labs documentation.
The platform connector is a FREE connector that ships logs related to your Fivetran account to your destination. Not only is it a great way to have some visibility into your account, but we can see how Fivetran Transformations turn the logs into actionable insights!
Navigate to the sources.yml file in the /models/ directory. We have already added this but if you named your connector something besides the default (fivetran_log) than make the adjustment in the schema value.
A Github account is necessary for changing code and creating the right permissions to connect your project into Fivetran. Your company may have a Github organization you can join. There are also free plans available here.
Click Use This Template
in the top right of this project's landing page.
Next, click Create a new repository
.
Next, name your repository. You can use dbt_project
, or a naming convention of your choice.
We need to make a few changes to this repository to integrate with your Fivetran account. The following steps show how you can use Fivetran's open source data models to build on top of your Fivetran source data.
Navigate to the Fivetran documentation on data models. Select one of your Fivetran connector sources, and click on the transform
data model link.
In the transform documentation, this is usually found in Step 2
. Paste this snippet in the packages.yml
file in your new repository.
Feel free to modify, remove or keep any packages included in that file by default.
If needed, change the source location of the package to match your Fivetran connector. You can make this change in the dbt_project.yml
file in your repository. The schema and database names should align with the name of your Fivetran connector and the name of the connected database in your Fivetran destination.
In this case, I will want to take note of postgres_rds_animal_crossing
because this is the schema where my Fivetran loaded data resides. If you only have one schema, you may skip this step.
Navigate to your sources.yml
file in the models
folder. Paste your connector_schema_name to the schema
section in one of the source blocks. Then add your table names in the tables section. If you need help, read this post in the Fivetran Community.
Open your 0_staging
folder in the models directory and navigate to staging_example_one.sql
and staging_example_two.sql
.
Notice how these queries use a source
function. Modify these source jinja blocks to match the source tables you added in the step prior.
Navigate to Fivetran's Transformations tab in the dashboard. Get started from scratch or go to Settings
to begin the setup of dbt Core with GitHub. Copy Fivetran's SSH key to your newly created repository's 'deploy keys' and make sure you enter the SSH address of your repository in the setup form. A more complete guide can be found here.