This is the code repo for dbt tutorial at https://www.startdataengineering.com/post/dbt-data-build-tool-tutorial
- Docker and Docker compose
- dbt
- pgcli
- git
Clone the git repo and start the data warehouse docker container
git clone https://github.com/josephmachado/simple_dbt_project.git
docker compose up -d
export DBT_PROFILES_DIR=$(pwd)
cd sde_dbt_tutorial
dbt snapshot
dbt run
dbt test
dbt docs generate
dbt docs serve
Insert updates into source customer table, to demonstrate snapshot
pgcli -h localhost -U dbt -p 5432 -d dbt
# password is password1234
COPY warehouse.customers(customer_id, zipcode, city, state_code, datetime_created, datetime_updated) FROM '/input_data/customer_new.csv' DELIMITER ',' CSV HEADER;
\q
Run snapshot and create models again.
dbt snapshot
dbt run
You can log into the data warehouse to see the models.
pgcli -h localhost -U dbt -p 5432 -d dbt
# password is password1234
select * from warehouse.customer_orders limit 3;
\q
cd ..
docker compose down