Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mxssl/wait-for-pg
Check if PostgreSQL database is ready
https://github.com/mxssl/wait-for-pg
go golang postgres postgresql
Last synced: about 2 months ago
JSON representation
Check if PostgreSQL database is ready
- Host: GitHub
- URL: https://github.com/mxssl/wait-for-pg
- Owner: mxssl
- License: apache-2.0
- Created: 2019-11-08T20:20:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-29T14:30:51.000Z (4 months ago)
- Last Synced: 2024-08-29T16:12:49.645Z (4 months ago)
- Topics: go, golang, postgres, postgresql
- Language: Go
- Homepage:
- Size: 222 KB
- Stars: 24
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# wait-for-pg
Simple app that checks if PostgreSQL database is ready or not.
## Install and usage
### Option 1: binary
```sh
wget https://github.com/mxssl/wait-for-pg/releases/download/v1.0.1/wait-for-pg-linux-amd64.tar.gz
tar xvzf wait-for-pg-linux-amd64.tar.gz
mv wait-for-pg /usr/local/bin/wait-for-pg
chmod +x /usr/local/bin/wait-for-pg
rm wait-for-pg-linux-amd64.tar.gzwait-for-pg check \
--host postgres.domain.com \
--port 5432 \
--user pguser \
--password pgpass \
--dbname dbname \
--sslmode disable \
--retry 10 \
--sleep 2
```### Option 2: docker container
```sh
docker container \
run \
--rm \
mxssl/wait-for-pg:v1.0.1 \
wait-for-pg check \
--host postgres.domain.com \
--port 5432 \
--user pguser \
--password pgpass \
--dbname dbname \
--sslmode disable \
--retry 10 \
--sleep 2
```- If PG is ready then app returns exit code 0
- If PG isn't ready then app returns exit code 1