Created
January 24, 2025 20:40
-
-
Save joshleaves/583ce4fd16224ff3cec716e00e44edbe to your computer and use it in GitHub Desktop.
Powerline PSQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \set QUIET 1 | |
| \pset null '[NULL]' | |
| \x auto | |
| SELECT CASE WHEN inet_server_addr() IS NULL THEN '(SAFE)' ELSE '(UNSAFE)' END AS safety \gset | |
| SELECT CASE WHEN inet_server_addr() IS NULL THEN '2' ELSE '1' END AS safety_color \gset | |
| \set PROMPT1 '%[%033[0;34;40m%] %/%[%033[0;31;40m%]@SQL%[%033[0;3%:safety_color::40m%]%:safety: %[%033[0;30;44m%]⮀ %/ %[%033[0;34;4%:safety_color:m%]⮀%[%033[0;30;4%:safety_color:m%] %R %[%033[0;3%:safety_color:;40m%]⮀%[%033[0m%] ' | |
| \set PROMPT2 '%R ' | |
| \set VERBOSITY verbose | |
| \set HISTFILE ~/.psql_history- :DBNAME | |
| \set HISTCONTROL ignoredups | |
| \set COMP_KEYWORD_CASE upper | |
| \set QUIET 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment