diff --git a/dbt-models/README.md b/dbt-models/README.md index a292b589..3f668adb 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: %%DB_HOST%% + user: %%YOUR_USER%% + password: %%YOUR_PW%% + port: 5432 + dbname: %%DB_NAME%% + schema: analytics + threads: 4 + + dev: + type: postgres + host: %%DB_HOST%% + 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: