postgres-test-setup
Installation
SKILL.md
Postgres Test Setup
Spins up a Docker-based PostgreSQL instance, applies all SQL schema files from a database/ directory in dependency order, and seeds test data from .test_data.json sidecar files.
Quick reference
| What do you need? | Command |
|---|---|
| First-time setup | Follow steps 1–5 below |
| Add a new table | Create .sql + optional .test_data.json, then uv run -m test_server.start_postgres |
| Additive change (new column/index) | Edit .sql, apply via run_sql.py, no reset needed |
| Breaking change (rename/drop column) | Edit .sql, then uv run -m test_server.start_postgres --force-reset-db |
| Inspect test DB data | uv run test_server/run_sql.py --sql "SELECT ..." --results |
| Re-apply a function/view | uv run test_server/run_sql.py database/path/to/file.sql |
| Reset to clean slate | uv run -m test_server.start_postgres --force-reset-db |