Look, usql is basically someone's attempt to create one database client to rule them all. The idea is solid: instead of juggling psql, mysql, sqlite3, and whatever the fuck Oracle calls their client these days, you get one tool that connects to everything.
Does it work? Mostly. Will it occasionally make you want to throw your laptop out the window? Absolutely.
The Problem usql Tries to Solve
If you've worked with databases for more than five minutes, you know this pain: every database has its own special snowflake client. PostgreSQL has psql
(which is actually decent), MySQL has that mysql
command that never remembers your password correctly, and don't get me started on Oracle's sqlplus
- that thing feels like it was designed by someone who hates developers.
So you end up with:
- Different syntax for meta commands (`\d` vs `DESCRIBE` vs whatever)
- Different ways to format output
- Different config files in different places
- Different connection string formats that make no fucking sense
How usql Actually Works (When It Works)
usql takes the psql
interface - which most people actually like - and bolts on drivers for 40+ database systems. Version 0.19.25 connects to basically everything that speaks SQL and some things that don't.
Like most Go database tools, usql builds on the standard database/sql
package architecture. The universal client provides a consistent interface while different database drivers handle the backend-specific communication protocols.
The good parts:
- One tool, one syntax to remember
- `psql` users can jump right in
- Cross-database copy operations (when they don't crash)
- Actually decent syntax highlighting
The parts that'll bite you:
- Version 0.19.24 completely broke Presto support - had to rollback to 0.11
- macOS config is a mess - docs say
~/.config/usql
but it actually uses `~/Library/Application Support/usql` - ARM builds randomly fail with CGO linking errors
- Auto-completion is hit-or-miss depending on which database you're connected to
When You Should Actually Use This
usql shines when you're:
- Jumping between PostgreSQL, MySQL, and SQLite regularly
- Doing data migrations between different database types
- Working in environments where installing separate clients is a pain in the ass
- Already comfortable with `psql` and want that interface everywhere
When to just use the native client instead:
- If you only use one database type (seriously, just use `psql`)
- When you need database-specific features that usql doesn't support
- If you're doing anything performance-critical (native clients are faster)
- When the team already has workflows built around native tools
The bottom line: usql is useful enough that I keep it installed, but I still have psql
and mysql
as backups for when things go sideways.