Skip to content

nicor88/dbt-boilerplate

Repository files navigation

dbt-boilerplate

Requirements

  • Python >= 3

Setup

  • Install dbt running: make install-dbt
  • Init your dbt profile running: make init-dbt-profile
  • Run: make postgres-up to run a local instance of Postgres DB
  • If you want to stop your Postgres instance, run make postgres-down

Seed

The first step to do, it's to run the seed command, that will import static tables to your destination db. It's possible to create tables from static CSV files inside the data folder simply calling:

dbt seed --show

Run

The mostly easy command to run a model is: dbt run, but sometimes we want to be more specific

# call a model called my_model
dbt run --models my_model

# call all the models inside dimensions folder
dbt run --models dimensions

# call all the models with the tag sample
dbt run --models tag:fact

# call a model with a specific target
dbt run --models example --target dev

Test

# run all the test for the default target
dbt test

# test specific model
dbt test --models date_dim

Docs

# generate docs
dbt docs generate

# serve docs
dbt docs serve

Notes

This repo is based on the amazing example of jaffle_shop

TODO

  • Add a Makefile to init dbt, install libs, spin up Postgres locally
  • Find other interesting dataset to make other examples

About

Setup to initialize a dbt project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published