.
├───analyses/ # SQL files used for auditing queries
├───macros/ # SQL files for reusable functions
├───models/ # SQL files used to generate tables
├───seeds/ # CSV files used to populate initial data
├───snapshots/ # SQL files for handling type-2 data
├───tests/ # SQL files for automated tests
├───example.profiles.yml # Example YAML file used to configure a connection with Snowflake
├───dbt_project.yml # YAML file used to configure DBT
└───packages.yml # YAML file used to specify DBT extensions
DBT is a tool that extends SQL with features like code templating and order of execution. In this project, we leverage DBT to create reproducible database structures in Snowflake.
# Install the DBT CLI tool
$ python -m venv venv
$ venv/Scripts/pip install dbt-snowflake
$ source venv/Scripts/activate
# Configure your connection to Snowflake
$ cp example.profiles.yml profiles.yml
$ vi profiles.yml
# Test that the configuration works
$ dbt debug
# Install DBT extensions
$ dbt deps
$ dbt run
Note: Requires Snowflake admin permissions.
$ dbt run -t prod