Universal command-line interface for SQL databases
usql is a universal command-line interface that provides a unified way to work with multiple database systems including PostgreSQL, MySQL, Oracle, SQLite3, Microsoft SQL Server, and many other SQL and NoSQL databases. Inspired by PostgreSQL's psql tool, usql offers a familiar interface while extending support to dozens of different database types, making it possible to use the same command-line tool regardless of the underlying database technology.
The tool supports most core psql features like variables, backticks, and backslash commands, while adding unique capabilities that psql lacks. These include multiple database support within a single session, the ability to copy data between different database systems, syntax highlighting, context-based completion, and terminal graphics. This makes usql particularly powerful for database administrators and developers who work with heterogeneous database environments.
Database administrators and developers who prefer working with a psql-like interface but need to interact with non-PostgreSQL databases will find usql intuitive and easy to use. It serves as an excellent replacement for various database-specific command-line clients, eliminating the need to learn and maintain multiple different CLI tools for different database systems.
# 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