zsh: Add psql-ro alias for read-only psql connections
This commit is contained in:
parent
321c20de0d
commit
8525d37650
3 changed files with 7 additions and 1 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
- ./bin/set-colors
|
- ./bin/set-colors
|
||||||
- ./task/install
|
- ./task/install
|
||||||
|
|
||||||
- clean: ['~', '~/.config']
|
- clean: ["~", "~/.config"]
|
||||||
|
|
||||||
- link:
|
- link:
|
||||||
~/bin: bin/
|
~/bin: bin/
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
~/.my.cnf: mysql/.my.cnf
|
~/.my.cnf: mysql/.my.cnf
|
||||||
~/.npmrc: npm/.npmrc
|
~/.npmrc: npm/.npmrc
|
||||||
~/.psqlrc: psql/.psqlrc
|
~/.psqlrc: psql/.psqlrc
|
||||||
|
~/.psqlrc-readonly: psql/.psqlrc-readonly
|
||||||
~/.rgignore: etc/rgignore
|
~/.rgignore: etc/rgignore
|
||||||
~/.tmux.conf: tmux/.tmux.conf
|
~/.tmux.conf: tmux/.tmux.conf
|
||||||
~/.vimrc: vim/.vimrc
|
~/.vimrc: vim/.vimrc
|
||||||
|
|
|
||||||
3
psql/.psqlrc-readonly
Normal file
3
psql/.psqlrc-readonly
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
\pset expanded auto
|
||||||
|
|
||||||
|
SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;
|
||||||
|
|
@ -29,6 +29,8 @@ alias filestamp='date --utc "+%Y%m%dT%H%M%S"'
|
||||||
|
|
||||||
alias see='pee "cat >&2"'
|
alias see='pee "cat >&2"'
|
||||||
|
|
||||||
|
alias psql-ro='PSQLRC=~/.psqlrc-readonly psql'
|
||||||
|
|
||||||
docker-ip() {
|
docker-ip() {
|
||||||
docker inspect "$1" --format='{{.NetworkSettings.Networks.bridge.IPAddress}}'
|
docker inspect "$1" --format='{{.NetworkSettings.Networks.bridge.IPAddress}}'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue