1
0
Fork 0

zsh: Add psql-ro alias for read-only psql connections

This commit is contained in:
Jeremy Kaplan 2025-03-05 11:12:10 -05:00
commit 8525d37650
3 changed files with 7 additions and 1 deletions

View file

@ -7,7 +7,7 @@
- ./bin/set-colors
- ./task/install
- clean: ['~', '~/.config']
- clean: ["~", "~/.config"]
- link:
~/bin: bin/
@ -33,6 +33,7 @@
~/.my.cnf: mysql/.my.cnf
~/.npmrc: npm/.npmrc
~/.psqlrc: psql/.psqlrc
~/.psqlrc-readonly: psql/.psqlrc-readonly
~/.rgignore: etc/rgignore
~/.tmux.conf: tmux/.tmux.conf
~/.vimrc: vim/.vimrc

3
psql/.psqlrc-readonly Normal file
View file

@ -0,0 +1,3 @@
\pset expanded auto
SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;

View file

@ -29,6 +29,8 @@ alias filestamp='date --utc "+%Y%m%dT%H%M%S"'
alias see='pee "cat >&2"'
alias psql-ro='PSQLRC=~/.psqlrc-readonly psql'
docker-ip() {
docker inspect "$1" --format='{{.NetworkSettings.Networks.bridge.IPAddress}}'
}