🔧 More helpful psql scripts
This commit is contained in:
parent
bf70101503
commit
7e9c28eb1e
2 changed files with 23 additions and 2 deletions
21
scripts/psql-d
Executable file
21
scripts/psql-d
Executable 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue