Create a dbt Project
Learn how to create a dbt project in your Git repository.
Create new Git repository
Create a new repository for your new dbt project using your Git provider.
Set up a basic dbt project
Open a terminal window.
Ensure that you have dbt installed on your computer by running the
dbt --version
command.Run the
dbt init my_git_repo_name
command to create your starter dbt project.Open your source code editor.
Open the newly created dbt project.
Your dbt project cannot exceed 1 GB in size.
Connect dbt Core to destination
You'll use the profiles.yml
file to connect dbt to your destination. The file specifies which destination you're connecting to, the credentials to access that destination, and the schema that dbt Core will load your transformed data into. Learn more in dbt Labs' Configuring your profile documentation.
The profiles.yml
file you'll configure in this step is generally used for local development and testing purposes. Once Fivetran begins to run your dbt commands, we generate the production version of the profiles.yml
file for your dbt project that you cannot view or edit.
Open the
profiles.yml
file that was automatically created as part of your dbt installation.profiles.yml
is a hidden file. It is created in your~/.dbt
folder, not in the dbt project.Set up your
profiles.yml
file to enable dbt Core to connect to your destination. How you configure this file differs based on your destination. See dbt Labs' Data platform connections documentation for setup instructions for your destination.For additional help, see dbt Labs'
profiles.yml
documentation.Be sure that the profile name in your
dbt_project.yml
file matches the profile name in yourprofiles.yml
file.The profile names only need to match for testing purposes. Once Fivetran begins to run your dbt commands, we ignore the profile name in your
dbt_project.yml
file.Run the
dbt run
command. If you have successfully linked your destination, you will see a Completed successfully message.
Link dbt project to Git repository
In a terminal window, ensure that you are in the directory of your new dbt project.
Run the following commands. Replace the example URL
https://github.com/USERNAME/dbt-tutorial.git
with the URL of your Git repository.git init -b main git add . git commit -m ‘add your commit message here’ git remote add origin https://github.com/USERNAME/dbt-tutorial.git git push -u origin main
Open your Git repository to view your new dbt project.
Proceed to the Transformations for dbt Core setup guide to connect your dbt project to Fivetran.