Skip to content

trstringer/psqlcm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

aa2dbfe Β· May 9, 2024

History

12 Commits
May 2, 2024
May 2, 2024
May 9, 2024
May 9, 2024
May 9, 2024
May 9, 2024

Repository files navigation

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

About

Local connection manager for PostgreSQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published