Introduction

DBT has a built-on orchestrator that allows you to run the ETL. Only the enabled (thoose with the weird +enabled: true syntax) models will be run. As all models are disabled by default (the store is lazy), only the models/dashboards manually toogle will be run.

How to run the store

All DBT commands schould be called from the cssXX.dashboards_store project. BEFORE calling a DBT command from cssXX.dashboards_store, make sure you have activated the Poetry environement by running poetry env activate && poetry install from core.dashboards_store.
To get a complete list of the available options, run dbt --help or, got to the official dbt documentation

The base command to run and test the store is the following :

dbt build

The base command is a faster alternative to manually running the following commands :

dbt compile
dbt seed
dbt run
dbt test

I have ... special needs :

I need to reload the seeds' definitions

add the --full-refresh option

dbt build --full-refresh  # Build can be replaced by run.

I want to materialize the transformations in another environment than the default one (ie, other than default target as defined in ~/.dbt/profiles.yml)

If you want to target another environment that the default one, use the --target option. you will need this to materialize the store in production.

dbt build --target prod  # Build can be replaced by every other dbt command such as seed or test.

I want to run only a specific SQL file

If you want to only run a specific SQL file, use the --select option.

dbt build --select <sql_file_name>  # The name of the model is the name of the file WITHOUT the `.sql` extension.

I want to run only a specific dashboards

if you want to only run the models from a specific mart or for a specific dashboards, use the --select +tag:<model> option.

dbt build --select tag:<name of the dashboard> # Where name of the dashboard is the same as the one from dbt_project.yaml
Please consult core.dashboards_store/dbt_project.yaml to find the tag of the model you want to run

About the + selector and the --select statement

You probably need the + selector to run the models when using the --select statement.

If you want to run both a models and its upstream dependancies, use the + selector. This is usually required since the models are dependant on the seeds and the seeds are dependant on the sources.

dbt build --select +tag:<name of the dashboard> # Where name of the dashboard is the same as the one from dbt_project.yaml

or

dbt build --select +<name of a mode> # Where name of the dashboard is the same as the one from dbt_project.yaml