Skip to content

Clone this repository to get up and running quickly with Fivetran Transformations for dbt Core™

Notifications You must be signed in to change notification settings

fivetran/example_dbt_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Step 1: Add the Fivetran Platform Connector to your list of connections

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!

Step 2: Add the Fivetran Platform Connector as a source

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.

Step 3: Create a GitHub account

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.

Step 4: Copy this repository

Click Use This Template in the top right of this project's landing page.

Screenshot 2023-07-24 at 12 23 43 PM

Next, click Create a new repository.

Screenshot 2023-07-24 at 12 23 50 PM

Next, name your repository. You can use dbt_project, or a naming convention of your choice.

Screenshot 2023-07-24 at 12 24 09 PM

Step 5: Install dbt packages

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.

Choose your data model

Navigate to the Fivetran documentation on data models. Select one of your Fivetran connector sources, and click on the transform data model link. image

Copy the package code snippet

In the transform documentation, this is usually found in Step 2. Paste this snippet in the packages.yml file in your new repository. image

Feel free to modify, remove or keep any packages included in that file by default.

Match the package source to your Fivetran source

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.

image

Step 6: Add custom SQL (optional)

Note your Fivetran connector names and schemas

image

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.

image

Define your Fivetran sources

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.

Match the SQL source to your Fivetran source

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.

Step 7: Connect your new repository to Fivetran

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.

About

Clone this repository to get up and running quickly with Fivetran Transformations for dbt Core™

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published