easysql (esql)
Canonical: gitlab.com/safteinzz/easysql ยท Mirror: github.com/safteinzz/easysql
getting to the sql prompt, quick and easy - saved connections, their passwords and their tunnels in one CLI + TUI
Install
No cargo yet? Rust installs the same way on every distro: rustup.rs.
The real clients have to be on the machine, and cargo cannot bring them: they are not Rust. easysql works out the one command your machine needs and offers to run it, so you never have to go and find out.

What you see first
Every connection you have saved, from every engine, in one list. Green answered,
red did not, yellow means the tunnel it needs is not running. pw is a password
already on file, and no client is the program that would open it missing.

When it needs a tunnel
A forward dies with a reboot; the connection that needs it does not. easysql remembers which one, says so before you press anything, and Enter reopens it and connects in one step.

The command, built for you
The wizard shows the command it is building and what that command resolves to, so nothing about it is a surprise. Keys you added by hand are carried through untouched, and the file is backed up before every write.

Passwords, where the client looks
Typed once into a hidden field, written straight to the file that engine's client reads, and never read back, never echoed, never put in an argv or an environment variable. easysql only ever shows you that one exists.

Tunnels are just ssh -L
Opened from the connection that needs one, with every field already filled in.
Each forward says which connection it serves, and d kills it.

Settings
Which program opens each engine, whether ports are checked, what order the list
is in. d puts any of them back.

Commands
The handful of things faster to type than to click. Everything else is in the
toolbox, where ? lists every key.

What it edits
| tab | what it is | the file it edits |
|---|---|---|
| Connections | every saved connection, from every engine | ~/.pg_service.conf, ~/.my.cnf, ~/.config/easysql/{sqlite,mssql}.conf |
| Passwords | what unlocks them, written and never read back | ~/.pgpass, ~/.my.cnf (both chmod 600) |
| Tunnels | the ssh -L between you and a database you cannot route to |
tracked by pid, killable |
| Settings | the choices that are yours rather than a client's | ~/.config/easysql/settings |
Every write backs the file up first and rewrites only the one section, so your own comments, ordering and extra keys survive.
When it fails
A connect that does not work is the interesting case, so easysql asks the server the same question again non-interactively, reads the client's own answer, and offers the step that would actually get you in:
no password suppliedโ save one in~/.pgpassConnection refused, orno pg_hba.conf entry for hostโ open an ssh tunneldatabase "x" does not existโ edit the connection
Notes
- Nothing is sent anywhere. A front end, not a client: easysql speaks no wire protocol and holds no connection open, it writes the files your tools already read and runs them, so uninstalling it costs you nothing.
- apt, pacman, dnf, zypper and apk are recognised for the install offer. On anything else easysql names the program rather than guessing a package.
Compatibility
Four engines, each handed over to the client you already have: Postgres to
psql, MySQL and MariaDB to mysql, SQLite to sqlite3, SQL Server to
sqlcmd. Any of them can be pointed somewhere else in Settings.
SQL Server is the odd one out twice: no file both sqlcmd builds read, so
easysql keeps that list itself and passes -S host,port -d db -U user, and it
saves no password, because sqlcmd asking you is Microsoft's own advice over
-P. It is in no distro's repos either, so there is no install to offer.
Linux. Tunnel liveness is read from /proc and killing a forward shells out to
kill, so macOS and BSD need a different implementation first.
License
AGPL-3.0-only