| 12345678910111213141516171819202122232425262728 | #!/usr/bin/env bashset -xset -eo pipefailif ! [ -x "$(command -v psql)" ]; then  echo >&2 "Error: `psql` is not installed."  echo >&2 "install using brew: brew install libpq."  echo >&2 "link to /usr/local/bin: brew link --force libpq ail"  exit 1fiif ! [ -x "$(command -v sqlx)" ]; then  echo >&2 "Error: `sqlx` is not installed."  echo >&2 "Use:"  echo >&2 "    cargo install --version=0.5.5 sqlx-cli --no-default-features --features postgres"  echo >&2 "to install it."  exit 1fiuntil psql -h "localhost" -U "${DB_USER}" -p "${DB_PORT}" -d "postgres" -c '\q';do  >&2 echo "Postgres is still unavailable - sleeping"  sleep 1done>&2 echo "Postgres is up and running on port ${DB_PORT}!"sqlx database create
 |