Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Connection settings for the shared Azure PostgreSQL database.
#
# 1. Copy this file to .env: cp .env.example .env
# 2. Fill in the real values below (the class vault has them; ask your mentor if any are missing).
# 3. Load them into your shell before running dbt: source .env
#
# .env is git-ignored β€” never commit it with a real password.

export PG_HOST=<your-server>.postgres.database.azure.com
export PG_USER=<your_login>
export PG_PASSWORD=<your_password>
export PG_DBNAME=postgres
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This repo is a **ready-to-run dbt project**: the project config is wired up and
β”œβ”€β”€ dbt_project.yml <- ready to run: staging = view, marts = table
β”œβ”€β”€ packages.yml <- TODO stub: declare dbt_utils (Task 5)
β”œβ”€β”€ profiles.yml.example <- connection template: copy to profiles.yml
β”œβ”€β”€ .env.example <- env var template: copy to .env, fill in, then source it
β”œβ”€β”€ macros/
β”‚ └── safe_divide.sql <- TODO stub: implement the macro
β”œβ”€β”€ models/
Expand Down Expand Up @@ -46,15 +47,16 @@ cp profiles.yml.example profiles.yml
# edit profiles.yml: replace <your_name> so schema reads dev_<your_name>
```

2. Export the connection env vars (values are in the class vault; ask your mentor if you are missing them):
2. Set the connection env vars (values are in the class vault; ask your mentor if you are missing them). Copy the template, fill in the real values, and load them into your shell:

```bash
export PG_HOST=...
export PG_USER=...
export PG_PASSWORD=...
export PG_DBNAME=postgres
cp .env.example .env
# edit .env: fill in PG_HOST, PG_USER, PG_PASSWORD (PG_DBNAME stays postgres)
source .env
```

`.env` is git-ignored, so your password stays out of Git. Run `source .env` again in any new terminal before running dbt.

3. Verify: `dbt debug` must end with `All checks passed!`.

`profiles.yml` is git-ignored. Never commit it: the autograder treats a committed `profiles.yml` as a blocker.
Expand Down
2 changes: 2 additions & 0 deletions profiles.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ nyc_taxi_borough_daily:
password: "{{ env_var('PG_PASSWORD') }}"
dbname: "{{ env_var('PG_DBNAME', 'postgres') }}"
schema: "dev_<your_name>" # TODO: replace <your_name> with your first name (the schema you already own)
sslmode: require # Azure Database for PostgreSQL requires an encrypted connection
threads: 1

# Copy this file to profiles.yml (same directory), fill in your name, and ensure
# PG_HOST, PG_USER, PG_PASSWORD, and PG_DBNAME are set in your environment.
# The quickest way to set them: cp .env.example .env, fill in .env, then run: source .env
# profiles.yml is git-ignored β€” never commit it with a real password.
Loading