
usql
Universal command-line SQL client with PostgreSQL psql-inspired interface for multiple databases
usql is a universal command-line SQL client that provides a psql-compatible interface for working with multiple database systems. It supports PostgreSQL, MySQL, Oracle, SQLite3, Microsoft SQL Server, and many other SQL and NoSQL databases through a single unified interface. The tool replicates most core psql features including variables, backticks, and backslash commands while extending functionality with multi-database support and database-to-database copying.
The client includes syntax highlighting, context-based completion, and terminal graphics capabilities that enhance the interactive experience beyond what psql offers. Database administrators and developers can use the same familiar psql-style commands across different database systems, eliminating the need to learn multiple database-specific CLI tools.
usql supports over 30 database drivers through Go's SQL interface, with build tags allowing users to compile only the drivers they need. The tool can be built with base drivers (PostgreSQL, MySQL, SQLite3, SQL Server, Oracle, CSVQ), most drivers, or all available drivers including CGO-dependent ones. Installation options include system package managers, Go toolchain, and Docker containers.
Installation
# via Homebrew
brew install xo/xo/usql
# via Go
go install github.com/xo/usql@latest
# via Docker
docker run --rm -it docker.io/usql/usql:latest
Alternatives & related tools
miller
Command-line data processing tool for CSV, TSV, JSON, and JSON Lines with field-based operations
pup
Command line HTML processing tool using CSS selectors to filter and extract data from HTML documents
dasel
Command-line tool for querying, modifying, and transforming structured data files (JSON, YAML, TOML, XML, CSV)
jid
Interactive JSON explorer that takes piped input and lets you drill down with dot-path or JMESPath queries, with tab completion and suggestions.
gron
Transforms JSON into discrete assignments to make it greppable and enable exploration of complex JSON structures
add a badge to your README
Maintain usql? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/usql?utm_source=badge)<a href="https://www.trmn.sh/tools/usql?utm_source=badge"><img src="https://www.trmn.sh/badge/usql.svg" alt="Featured on trmn" height="20"></a>