notes/scripts/pgcli-d
2024-06-09 17:36:40 -07:00

21 lines
No EOL
312 B
Bash
Executable file

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