usql
Universal command-line database client
TLDR
SYNOPSIS
usql [-c command] [-f file] [options] connectionurl_
DESCRIPTION
usql is a universal command-line interface for SQL databases. It connects to PostgreSQL, MySQL, SQLite, SQL Server, Oracle, and many other databases (including NoSQL databases) with a consistent psql-inspired interface.
Connection strings follow URL format. The scheme identifies the database type: postgres://, mysql://, sqlite:, mssql://, oracle://, etc. When no scheme is given, usql auto-detects: directories use PostgreSQL, regular files use SQLite3 or DuckDB.
Backslash commands work across databases: \\l lists databases, \\dt lists tables, \\d describes objects, \\drivers lists available database drivers.
Query output can be formatted as tables, CSV, JSON, or other formats. Tab completion assists with table and column names, and history persists across sessions.
PARAMETERS
-c CMD
Execute command and exit.-f FILE
Execute file.-o FILE
Output to file.-w, --no-password
Never prompt for password.-W, --password
Always prompt for password.-X, --no-rc
Don't read rc file.-t, --tuples-only
Only print rows.-q, --quiet
Quiet mode.-v NAME=VALUE
Set variable.--help
Show help.--version
Show version.
CAVEATS
Not all features available on all databases. Some drivers need installation. Complex queries may have database-specific syntax.
HISTORY
usql was created by Kenneth Shaw around 2017 to provide a universal SQL client. It addresses the fragmentation of database CLIs with a single, consistent tool.

