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.
# 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