If you've ever had a terminal with pgAdmin open in one tab, a Redis CLI in another, MySQL Workbench somewhere in the background, and a MongoDB Compass window you forgot about — you know the pain. You're not actually doing database work. You're doing window management.
I hit this wall recently on a project that used PostgreSQL for the main data store, Redis for caching, and SQLite for a local analytics pipeline. Three databases, three completely different tools, three sets of keyboard shortcuts, three ways to export a query result. It's death by a thousand context switches.
The root problem isn't that these tools are bad individually. It's that no single client historically covered all the databases a modern project touches.
Why Multi-Database Tooling Is Broken
Most database clients fall into one of two camps:
- Specialized clients (pgAdmin, Redis Insight, MongoDB Compass) — great for one database, useless for everything else
- Universal GUI clients (DBeaver, DataGrip) — they cover a lot of databases but are heavyweight, often slow to start, and the free tiers can be limited
For quick development queries, neither camp is ideal. I don't need a full visual schema designer. I need to run a query, see the result, and get back to coding. The overhead of launching a full GUI app for a SELECT * FROM users WHERE id = 42 is absurd.
This is where lightweight, terminal-native database clients start to make a lot of sense.
Enter dbx: One CLI Client for (Almost) Everything
I stumbled on dbx recently — it's an open-source, cross-platform database client that supports MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, ClickHouse, SQL Server, and more from a single tool.
The pitch is simple: one binary, multiple database engines, terminal-native. No Electron app eating 800MB of RAM.
Getting Connected
The typical workflow with a tool like this looks something like:
# Connect to your PostgreSQL instance
dbx --driver postgres --host localhost --port 5432 --db myapp_dev --user dev
# Or hit a local SQLite file directly
dbx --driver sqlite --db ./analytics.db
# Connect to Redis
dbx --driver redis --host localhost --port 6379
The key thing here is the mental model stays the same regardless of the backend. You're not learning a new tool for each database — you're learning one interface and pointing it at different engines.
Running Queries Across Engines
Once connected, you interact with your database through a consistent interface. For SQL databases, you write SQL. For document stores like MongoDB, you use the query syntax appropriate to that engine. But the experience — connecting, viewing results, exiting — stays uniform.
-- Works the same whether you're on PostgreSQL, MySQL, or SQLite
SELECT u.email, COUNT(o.id) as order_count
FROM users u
LEFT JOIN orders o ON o.user_id = u.id
WHERE u.created_at > '2025-01-01'
GROUP BY u.email
ORDER BY order_count DESC
LIMIT 20;
No remembering whether it's psql's \dt or MySQL's SHOW TABLES. One tool, consistent behavior.
The Real Fix: Consolidating Your Database Workflow
Here's the step-by-step approach I've started using to tame the multi-database chaos:
Step 1: Audit Your Database Touchpoints
Before installing anything, figure out what you're actually connecting to day-to-day:
# Check what's running locally
# Look for common database ports
lsof -i :5432 # PostgreSQL
lsof -i :3306 # MySQL
lsof -i :6379 # Redis
lsof -i :27017 # MongoDB
lsof -i :9000 # ClickHouse
Most developers I know are touching 2-4 different database engines regularly. If you're only on one engine, a specialized client is probably fine. But the moment you hit two or more, consolidation pays off immediately.
Step 2: Replace Individual CLIs with a Unified Tool
Instead of maintaining muscle memory for psql, mysql, redis-cli, and mongosh separately, use a single client that normalizes the experience. A tool like dbx gives you that.
The advantage isn't just fewer tools to install — it's fewer tools to configure. One place for connection strings, one set of keybindings, one output format.
Step 3: Script Your Common Connections
Once you've settled on a unified client, alias your common connections:
# Add to your .bashrc or .zshrc
alias db-main='dbx --driver postgres --host localhost --port 5432 --db myapp_dev --user dev'
alias db-cache='dbx --driver redis --host localhost --port 6379'
alias db-analytics='dbx --driver sqlite --db ~/projects/myapp/analytics.db'
alias db-warehouse='dbx --driver duckdb --db ~/data/warehouse.duckdb'
Now switching between databases is literally typing db-main or db-cache. The cognitive overhead drops to near zero.
Step 4: Use It in CI and Scripting Too
A lightweight CLI tool shines in CI pipelines where you can't exactly install DBeaver. Need to verify a migration ran correctly? Need to seed test data across multiple database engines?
# In a CI script — verify migration on PostgreSQL
dbx --driver postgres --host $DB_HOST --db $DB_NAME --user $DB_USER \
-e "SELECT COUNT(*) FROM information_schema.columns WHERE table_name = 'users' AND column_name = 'email_verified';"
# Check Redis cache is warm after deploy
dbx --driver redis --host $REDIS_HOST \
-e "DBSIZE"
Having a single binary that handles multiple engines means your CI doesn't need to install three different client packages.
Prevention: Keeping Your Tooling Lean Going Forward
A few principles I've adopted:
- Default to one multi-engine client for day-to-day work. Only reach for a specialized tool when you need features the unified client genuinely lacks (like pgAdmin's visual EXPLAIN plans)
- Version-pin your database tools just like you version-pin your application dependencies. A database client update shouldn't silently change output formatting in your scripts
- Keep connection configs in dotfiles, not in GUI app preferences that don't survive a laptop migration
- Test your database tooling in CI before you need it in CI. Nothing worse than discovering your client doesn't support a flag when a deploy is waiting
When This Approach Doesn't Work
I want to be honest about the tradeoffs. A unified CLI client won't replace everything:
- If you live in visual query builders, you'll still want a GUI tool
- For complex schema visualization, specialized tools like pgAdmin or MongoDB Compass have dedicated features that a CLI can't match
- If your team is standardized on a specific client, switching for the sake of switching creates friction
But for the 80% of database interactions that are "run a query, see the result, move on" — a single lightweight tool like dbx eliminates a surprising amount of daily friction.
I haven't tested every database engine dbx supports, and the project is relatively new, so I'd suggest checking the GitHub repo for the latest on driver support and any known limitations. But the pattern of consolidating database clients into one tool? That's been a genuine quality-of-life improvement for me, regardless of which specific tool you choose to do it with.
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.