Skip to content

joel1091/dbt-postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbt-postgres

This repo contains a docker file to run PostgreSQL and PGAdmin using docker compose. It also contains some raw data from a fictional app and some indications to get started with dbt.

PostgreSQL - PGAdmin

Change to the right directory and run:

docker compose up

dbt steps

  1. Create a new virtual environment in your project and activate it.
python3 -m venv .venv

source .venv/bin/activate

Windows:

python -m venv .venv

.venv\Scripts\activate
  1. Then install dbt-core and the postgres adapter.

python3 -m pip install dbt-core dbt-postgres

  1. Create profiles.yml file to connect dbt to postgres.
mkdir ~/.dbt 

vi ~/.dbt/profiles.yml
  1. dbt init to create a new dbt project.

dbt init jaffle_shop

"The profile jaffle_shop already exists in /Users/...../profiles.yml. Continue and overwrite it? [y/N]:" --> n

  1. Delete the folder: jaffle_shop/models/example

  2. In dbt_project.yml, delete lines 35 and 36.

  3. Check connection

cd jaffle shop

dbt run
  1. Add csv files in seeds folder.

  2. Run seed to upload files to postgres

dbt seed

  1. Verify the data is available in pgAdmin and delete CSV files from seeds folder.

  2. Start modeling.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages