🔧 More helpful psql scripts

This commit is contained in:
z3rOR0ne 2024-09-10 07:06:40 -07:00
parent bf70101503
commit 7e9c28eb1e
2 changed files with 23 additions and 2 deletions

21
scripts/psql-d Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
printhelp() {
cat <<EOM
Usage psql-d DOCKER_PORT DATABASE_NAME USER_NAME
Example:
psql-d 5936 app_db admin
NOTE: password needed
EOM
exit 0
}
if [[ $# -lt 1 ]]; then
printhelp
fi
PORT=$1
DB_NAME=$2
USER_NAME=$3
psql -U "$USER_NAME" -h localhost -p "$PORT" -d "$DB_NAME"