CSRBot da7a2a0c92
Some checks failed
Lint Golang files / Run golang CI linter (stable, ubuntu-latest-arm64) (push) Waiting to run
Run Golang tests / Run unit tests (stable, ubuntu-latest-arm64) (push) Waiting to run
Lint Golang files / Run golang CI linter (stable, ubuntu-latest-arm64) (pull_request) Waiting to run
Lint Golang files / Run golang CI linter (stable, ubuntu-latest-amd64) (pull_request) Failing after 1m54s
Run Golang tests / Run unit tests (stable, ubuntu-latest-arm64) (pull_request) Waiting to run
Run Golang tests / Run unit tests (stable, ubuntu-latest-amd64) (pull_request) Successful in 1m5s
Lint Markdown files / Run markdown linter (pull_request) Successful in 16s
Lint Golang files / Run golang CI linter (stable, ubuntu-latest-amd64) (push) Failing after 2m55s
Run Golang tests / Run unit tests (stable, ubuntu-latest-amd64) (push) Failing after 10m11s
chore(deps): update module github.com/spf13/cobra to v1.10.1
2025-09-07 10:06:44 +00:00
2022-08-08 18:50:51 +02:00
2021-09-15 22:18:06 +02:00
2025-05-31 21:26:20 +02:00
2025-05-31 21:26:20 +02:00
2025-05-31 21:26:20 +02:00
2025-05-31 21:35:40 +02:00
2021-09-15 22:18:06 +02:00
2022-08-08 18:50:51 +02:00
2025-05-31 21:26:20 +02:00
2025-05-31 21:26:20 +02:00

db-wait

Docker Pulls

With db-wait is it possible to wait in CI/CD environments until a database connection can be established and SQL queries are possible.

This is very useful for example when a database is started for an integration test and it needs time to start and initialize all schemes before the test connects to it.

Usage

As argument db-wait expects a database URI. This can be different depending on the backend. Currently only oracle and postgres are supported. The supported URI patterns can be found in the respective library or directly in the documentation of the database backend.

For example:

# postgres
db-wait postgres://user:password@localhost:5432/postgres?sslmode=disable

# oracle
db-wait oracle://user:password@localhost:1521/xe

More about URI Pattern is documented here for oracle and postgres.

Installation

There are two ways to install db-wait. Directly via go or via make in combination with git and go. The advantage of the second option is that the binary is installed with all the additional files that the developer specifies.

# go
$ go install git.cryptic.systems/volker.raschek/db-wait

# git, make, go
$ git clone https://git.cryptic.systems/volker.raschek/db-wait.git && \
  cd db-wait && \
  make install PREFIX=/usr

Usage as container image

Alternatively can be db-wait used as container image. A local installation is not necessary.

# postgres
$ docker run --rm --network host git.cryptic.systems/volker.raschek/db-wait:latest \
    postgres://user:password@localhost:5432/postgres?sslmode=disable

# oracle
$ docker run --rm --network host git.cryptic.systems/volker.raschek/db-wait:latest \
    oracle://user:password@localhost:1521/xe
Description
Wait until database connection can be successfully established
Readme 383 KiB
v0.2.1 Latest
2025-05-31 21:35:50 +02:00
Languages
Makefile 56.4%
Go 42.5%
Dockerfile 1.1%