usql
One command line for PostgreSQL, MySQL, SQLite, SQL Server, Oracle, DuckDB and many other databases. It works like psql.
usql opens a database from a URL, such as pg://user@host/db or my://localhost/db, or from a file on disk. The prompt takes SQL and psql’s backslash commands, such as \d, \copy, \set and \pset. It also has commands that psql does not have: \copy between two databases, \dump, and \chart, which draws a chart in the terminal.
Learn usql
Section titled “Learn usql”- Install usql.
- Take the first steps.
- If you know psql, read Coming from psql.
- Read a guide, such as Connect to a database or Copy data between databases, or a recipe, such as Export a query to CSV.
- Look up an option, a meta command or a setting.