docs(nebraska): add docker exec option for postgres setup - #701
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The updated doc section has formatting that will likely render awkwardly and Option A’s timezone command is non-persistent/inconsistent with the stated requirement to set the DB timezone to UTC.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the Nebraska development documentation to provide an additional way to initialize the local PostgreSQL databases when the psql client is not installed on the host machine.
Changes:
- Converts the Postgres container startup command into a standalone command block.
- Adds “Option A” (local
psql) and “Option B” (docker exec) instructions for creating databases and setting timezone.
File summaries
| File | Description |
|---|---|
| content/docs/latest/updates-releases/nebraska/development.md | Adds a docker exec-based Postgres setup path alongside the existing local psql instructions. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟢 Approval recommended
The change is documentation-only and the new docker exec workflow is coherent and consistent with the stated goal of supporting users without local psql.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
| - Create the database for Nebraska (by default it is `nebraska`): | ||
| - `psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska;'` | ||
| ```bash | ||
| docker run --rm -d --name nebraska-postgres-dev -p 5432:5432 -e POSTGRES_PASSWORD=nebraska postgres |
There was a problem hiding this comment.
🟡 Changes recommended
The new readiness snippet uses exit 1, which can unexpectedly terminate an interactive shell session when copy/pasted from the docs.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
| - Initialize the databases (`nebraska` and `nebraska_tests`) using either of the following methods: | ||
|
|
||
| ```bash | ||
| psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska_tests;' | ||
| psql postgres://postgres:nebraska@localhost:5432/nebraska_tests -c 'set timezone = "utc";' | ||
| ``` | ||
| - **Option A: Using local `psql`** (if you have `psql` installed on your host machine): | ||
|
|
||
| ```bash | ||
| # Create the database for Nebraska (by default it is `nebraska`) | ||
| psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska;' | ||
|
|
||
| # Set the timezone to Nebraska's database | ||
| psql postgres://postgres:nebraska@localhost:5432/nebraska -c "alter database nebraska set timezone to 'utc';" | ||
|
|
||
| # Set up the nebraska_tests database for running unit tests | ||
| psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska_tests;' | ||
| psql postgres://postgres:nebraska@localhost:5432/nebraska_tests -c "alter database nebraska_tests set timezone to 'utc';" | ||
| ``` | ||
|
|
||
| - **Option B: Using `docker exec`** (run directly inside the container without requiring local PostgreSQL tools): | ||
|
|
||
| ```bash | ||
| # Create the database for Nebraska (by default it is `nebraska`) | ||
| docker exec nebraska-postgres-dev psql -U postgres -c "create database nebraska;" | ||
|
|
||
| # Set the timezone to Nebraska's database | ||
| docker exec nebraska-postgres-dev psql -U postgres -c "alter database nebraska set timezone to 'utc';" | ||
|
|
||
| # Set up the nebraska_tests database for running unit tests | ||
| docker exec nebraska-postgres-dev psql -U postgres -c "create database nebraska_tests;" | ||
| docker exec nebraska-postgres-dev psql -U postgres -c "alter database nebraska_tests set timezone to 'utc';" | ||
| ``` |
There was a problem hiding this comment.
The docker run command in the previous suggestion now sets POSTGRES_DB and TZ, so the nebraska database and the UTC timezone are already handled when the container starts. Only the test database is left to create here.
That also means we do not need the two options. We can simplify the doc. The docker run bullet already needs Docker, so docker exec works for every reader, while local psql only works for people who have it installed.
Let me know if you see a reason to keep them.
| - Initialize the databases (`nebraska` and `nebraska_tests`) using either of the following methods: | |
| ```bash | |
| psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska_tests;' | |
| psql postgres://postgres:nebraska@localhost:5432/nebraska_tests -c 'set timezone = "utc";' | |
| ``` | |
| - **Option A: Using local `psql`** (if you have `psql` installed on your host machine): | |
| ```bash | |
| # Create the database for Nebraska (by default it is `nebraska`) | |
| psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska;' | |
| # Set the timezone to Nebraska's database | |
| psql postgres://postgres:nebraska@localhost:5432/nebraska -c "alter database nebraska set timezone to 'utc';" | |
| # Set up the nebraska_tests database for running unit tests | |
| psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska_tests;' | |
| psql postgres://postgres:nebraska@localhost:5432/nebraska_tests -c "alter database nebraska_tests set timezone to 'utc';" | |
| ``` | |
| - **Option B: Using `docker exec`** (run directly inside the container without requiring local PostgreSQL tools): | |
| ```bash | |
| # Create the database for Nebraska (by default it is `nebraska`) | |
| docker exec nebraska-postgres-dev psql -U postgres -c "create database nebraska;" | |
| # Set the timezone to Nebraska's database | |
| docker exec nebraska-postgres-dev psql -U postgres -c "alter database nebraska set timezone to 'utc';" | |
| # Set up the nebraska_tests database for running unit tests | |
| docker exec nebraska-postgres-dev psql -U postgres -c "create database nebraska_tests;" | |
| docker exec nebraska-postgres-dev psql -U postgres -c "alter database nebraska_tests set timezone to 'utc';" | |
| ``` | |
| - Create the second database, used by the unit tests: | |
| ```bash | |
| docker exec nebraska-postgres-dev psql -U postgres -c "create database nebraska_tests;" | |
| ``` |
There was a problem hiding this comment.
The only reason I kept psql and added the docker exec option was that psql was already in the doc first, and I was afraid I might have missed something.
If you think docker exec is enough and better, we should remove psql.
Signed-off-by: R4 Cheng <karaburi2023@gmail.com>
There was a problem hiding this comment.
🟡 Changes recommended
The updated instructions claim the database timezone is set to UTC, but the current commands do not reliably configure PostgreSQL’s timezone setting.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
Docs(nebraska): add
docker execoption for postgres setupPreviously, the Nebraska development setup guide only provided commands assuming the
psqlclient was installed directly on the host machine.This PR add another database setup method for no
psqluser.Testing done
I ran new command on my Mac book and it worked.
changelog/directory: N/A