Skip to content

Installation guide dbt #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 51 additions & 4 deletions dbt-models/README.md
Original file line number Diff line number Diff line change
@@ -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_<YOUR_NAME>
threads: 4
```

### Using the starter project

```sh
export DBT_PROFILES_DIR=$(pwd)
dbt run
dbt test
```

### Resources:
Expand Down