https://github.com/trstringer/psqlcm
Local connection manager for PostgreSQL
https://github.com/trstringer/psqlcm
Last synced: 7 months ago
JSON representation
Local connection manager for PostgreSQL
- Host: GitHub
- URL: https://github.com/trstringer/psqlcm
- Owner: trstringer
- Created: 2024-05-02T10:44:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-09T01:57:06.000Z (over 1 year ago)
- Last Synced: 2024-10-11T15:12:11.700Z (over 1 year ago)
- Language: Go
- Size: 17.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# psqlcm (psql connection manager)
Manage your PostgreSQL connections locally.
## Build
```
$ make build
```
Copy `./bin/psqlcm` to a path dir.
Because `psqlcm` encrypts the password before storing it, you must set `PSQLCM_KEY` prior to running `login` and `show`.
## Usage
```
NAME:
psqlcm - psql connection manager
USAGE:
psqlcm [global options] command [command options]
COMMANDS:
new New connection
list, ls List all available connections
show Show a connection string
delete, del, remove Remove a cached connection
set-current Set a connection as current
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
```
### Add a connection
```
$ psqlcm new
🖥️ Hostname [localhost]: 127.0.0.1
🌐 Port [5432]:
📝 Database [postgres]: mydb1
🔨 User [postgres]: myuser1
🔑 Password:
🔒 SSL mode [require]: disable
📕 Connection name [pg1715219721581]: my-connection1
⚡ Test connection [Y/n]: n
Connection saved!
```
*Note: The password is encrypted and cached locally. The plaintext password is never stored.*
### List all connections
```
$ psqlcm ls
new-connection1
```
### Show a connection string
```
$ psqlcm show new-connection1
postgresql://user1:mysecretpassword@host1:5432/db1
```
### Delete a connection
```
$ psqlcm delete new-connection1
Connection "new-connection1" deleted
```