Ecto/PostgreSQL persistence layer for the Mastery poncho project (Designing Elixir Systems with OTP, ch. 9).
A local Postgres instance runs via Docker Compose.
Start it:
docker compose up -dStop it (data persists in the mastery_persistence_pgdata volume):
docker compose downLogs:
docker compose logs -fConnection details (used both by config/*.exs and any external client):
| Field | Value |
|---|---|
| Host | 127.0.0.1 |
| Port | 5432 |
| User | postgres |
| Password | postgres |
Install the PostgreSQL (Microsoft) extension, then in the PostgreSQL panel in the sidebar:
- Add Connection
- Server:
127.0.0.1(notlocalhost— DNS resolution forlocalhostfails in this environment) - Port:
5432 - Database:
mastery_dev(add a second connection withmastery_testif you need to inspect test data mid-transaction) - Authentication: Password — User
postgres, Passwordpostgres - SSL: disabled (local dev container has no SSL configured)
Requires Postgres running (see above).
mix ecto.create
mix ecto.migrate
MIX_ENV=test mix ecto.create
MIX_ENV=test mix ecto.migrate