#!/usr/bin/env bash set -x set -eo pipefail until psql -h "localhost" -U "${DB_USER}" -p "${DB_PORT}" -d "postgres" -c '\q'; do >&2 echo "Postgres is still unavailable - sleeping" sleep 1 done >&2 echo "Postgres is up and running on port ${DB_PORT}!" sqlx database create