From d7b2fc863ea80a178fdfd7283af13004779ece82 Mon Sep 17 00:00:00 2001 From: Marie Lestavel <49002487+marielestavel@users.noreply.github.com> Date: Fri, 10 Feb 2023 11:08:21 +0100 Subject: [PATCH 1/2] Update README.md --- dbt-models/README.md | 55 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/dbt-models/README.md b/dbt-models/README.md index a292b589..14bfbf55 100644 --- a/dbt-models/README.md +++ b/dbt-models/README.md @@ -1,11 +1,58 @@ -Welcome to your new dbt project! +## Install dbt + +```sh +pip install dbt-postgres +``` + +### Clone dbt repo: +``` +git clone https://github.com/marielestavel/mongo-to-postgres-etl.git +``` + +### Install dependencies + +```sh +export DBT_ENV_SECRET_GIT_CREDENTIAL=$GITHUB_TOKEN +``` + +### Check dbt version and update dbt dependencies +``` +dbt --version +dbt deps +``` + +### Configure dbt +To be able to interact with the SQL database, the dbt profile should be configured. +Add the following configuration to your profiles.yml, keep in mind that you need to replace %%YOUR USER%% and %%YOUR_PW%% with your +own credentials: +``` +la_porte_bleue: + target: dev + outputs: + prod: + type: postgres + host: %%HOST%% + user: %%YOUR_USER%% + password: %%YOUR_PW%% + port: 5432 + dbname: %%DB_NAME%% + schema: analytics + threads: 4 + + dev: + type: postgres + host: db.eddmcnfdgbktebjetyjd.supabase.co + user: %%YOUR_USER%% + password: %%YOUR_PW%% + port: 5432 + dbname: %%DB_NAME%% + schema: dbt_ + threads: 4 +``` -### Using the starter project ```sh export DBT_PROFILES_DIR=$(pwd) -dbt run -dbt test ``` ### Resources: From 4885d19f5adc5f0f3f0cc2db9e99c0364b8c570d Mon Sep 17 00:00:00 2001 From: Marie Lestavel <49002487+marielestavel@users.noreply.github.com> Date: Fri, 10 Feb 2023 11:10:06 +0100 Subject: [PATCH 2/2] Update README.md --- dbt-models/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt-models/README.md b/dbt-models/README.md index 14bfbf55..3f668adb 100644 --- a/dbt-models/README.md +++ b/dbt-models/README.md @@ -31,7 +31,7 @@ la_porte_bleue: outputs: prod: type: postgres - host: %%HOST%% + host: %%DB_HOST%% user: %%YOUR_USER%% password: %%YOUR_PW%% port: 5432 @@ -41,7 +41,7 @@ la_porte_bleue: dev: type: postgres - host: db.eddmcnfdgbktebjetyjd.supabase.co + host: %%DB_HOST%% user: %%YOUR_USER%% password: %%YOUR_PW%% port: 5432