-
Notifications
You must be signed in to change notification settings - Fork 61
fix(ps-cache-kotlin): use psql -c instead of heredoc for schema setup #125
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -59,17 +59,19 @@ docker run -d --name pg-demo \ | |||||
| -e POSTGRES_DB=testdb \ | ||||||
| -p 5432:5432 postgres:16 | ||||||
|
|
||||||
| # Wait for Postgres to be ready | ||||||
| sleep 3 | ||||||
|
|
||||||
| # Create the schema and seed data | ||||||
| docker exec pg-demo psql -U postgres -d testdb -f- <<'SQL' | ||||||
| CREATE SCHEMA IF NOT EXISTS travelcard; | ||||||
| CREATE TABLE IF NOT EXISTS travelcard.travel_account ( | ||||||
| docker exec pg-demo psql -U postgres -d testdb -c " | ||||||
|
||||||
| docker exec pg-demo psql -U postgres -d testdb -c " | |
| docker exec pg-demo psql -X -v ON_ERROR_STOP=1 -U postgres -d testdb -c " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a fixed
sleep 3for Postgres readiness is flaky (startup time varies by machine). Consider waiting onpg_isreadyin a loop (similar to the docker-compose healthcheck inps-cache-kotlin/docker-compose.yml) so the README steps are deterministic.