Step 2: Configure your dbt project to run with DuckDB#
Running dbt requires a data warehouse to store the tables that are created from the dbt models. For our data warehouse, we'll use DuckDB, because setting it up doesn't require any long-running services or external infrastructure.
You'll set up dbt to work with DuckDB by configuring a dbt profile:
Navigate into the jaffle_shop folder, which was created when you downloaded the project, inside your tutorial-dbt-dagster folder:
cd jaffle_shop
In this folder, with your text editor of choice, create a file named profiles.yml and add the following code to it:
jaffle_shop:target: dev
outputs:dev:type: duckdb
path: tutorial.duckdb
threads:24
With the profile configured above, your dbt project should now be usable. To test it out, run:
dbt build
This will run all the models, seeds, and snapshots in the project and store a set of tables in your DuckDB database.
Heads up! For other dbt projects, you may need to run additional commands before building the project. For instance, a project with dependencies will require you to run dbt deps before building the project. Visit the official dbt Command reference page for more information.