Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baburdick/psqlrc-files
Useful .psqlrc config system with grouped aliases, a fancy colorized two-line prompt, and useful bundled admin queries
https://github.com/baburdick/psqlrc-files
Last synced: 10 days ago
JSON representation
Useful .psqlrc config system with grouped aliases, a fancy colorized two-line prompt, and useful bundled admin queries
- Host: GitHub
- URL: https://github.com/baburdick/psqlrc-files
- Owner: baburdick
- License: mit
- Created: 2014-09-12T00:26:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-28T23:51:01.000Z (over 7 years ago)
- Last Synced: 2024-08-13T07:04:17.340Z (4 months ago)
- Homepage:
- Size: 9.77 KB
- Stars: 45
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - baburdick/psqlrc-files - Useful .psqlrc config system with grouped aliases, a fancy colorized two-line prompt, and useful bundled admin queries (Others)
README
# psqlrc-files
What you get:* `.psqlrc` with a fancy prompt
* an extensible aliases system
* useful basic admin queries# Get started
Copy the `.psqlrc*` files to `~/`. That's it! The next time you use `psql` from your shell, you'll have access to these predefined admin queries.You'll see a colorized two-line prompt displaying the date, your initial login user, the host, the port, and the DB to which you've connected.
# Add an aliases group
* add a directory at `~/.psqlrc-aliases/my_special_queries` that contains the queries to be referenced in your index.
* add an index file at something like `~/.psqlrc-my_special_queries` resembling the `.psqlrc-admin` file. Each entry will reference a single-query file in `~/.psqlrc-aliases/my_special_queries`.
* Finally, at the bottom of `.psqlrc` add a line like this to link to your new aliases index:\ir .psqlrc-my_special_queries
That's it! The next time you use `psql` from your shell, you'll have access to these queries by the shortcuts you've defined.
# Contributions
Please fork the repo and issue a pull request. Good additions are always welcome.