4. Set up your project locally
In this section we will set up the project development environment on your own computer. After everything has been set up, you will be able to run the dbt tests that are included locally.
4.1 Run the dbt project locally
If you are using Windows we assume you are using WSL2
We added a Makefile to the project to simplify the commands to run as well as to eliminate the need for installing things locally.
First start by running the following command: make shell
This starts a docker container with your project code in it and containing all the necessary dependencies.
From this shell you can execute the other Makefile commands like: make run
.
The duckdb
database runs in-memory but it is also persisted to disk in the dbt.duckdb
file of your dbt projet.
To show the state of your database after running your models, you can execute the following python script python3 query_duckdb.python
.
Apart from running the dbt models, you can also execute the tests from within the shell by using the make test
command.
If you want to install duckdb locally such that you can execute queries from the CLI instead of using python code, go to following link for detailed instructions