LinuxCommandLibrary

harlequin

terminal-based SQL IDE supporting multiple database backends

TLDR

Connect to DuckDB database

$ harlequin [database.db]
copy
Connect to SQLite database
$ harlequin -a sqlite [database.sqlite]
copy
Connect to PostgreSQL
$ harlequin -a postgres -h [localhost] -p [5432] -U [user] -d [database]
copy
Connect to MySQL
$ harlequin -a mysql -h [localhost] -u [user] -p [database]
copy
Open in-memory DuckDB
$ harlequin
copy
Query Parquet files
$ harlequin [data.parquet]
copy
Connect with connection string
$ harlequin "postgresql://[user]:[pass]@[host]/[db]"
copy
Set read-only mode
$ harlequin --read-only [database.db]
copy

SYNOPSIS

harlequin [options] [connection]

DESCRIPTION

harlequin is a terminal-based SQL IDE supporting multiple database backends. It provides a rich interface for writing queries, exploring schemas, and viewing results.
The interface shows a schema browser, query editor with syntax highlighting, and results pane. Multiple query tabs enable working on several queries simultaneously.
DuckDB is the default adapter, enabling direct querying of Parquet, CSV, and JSON files. Other adapters connect to traditional databases like PostgreSQL, MySQL, and SQLite.
Query results display in a scrollable table with export options. History and autocomplete assist query writing. The schema browser shows tables, columns, and types.
Configuration via config file or environment variables sets defaults for themes, limits, and connection preferences.

PARAMETERS

-a, --adapter name

Database adapter: duckdb (default), sqlite, postgres, mysql, bigquery.
-h, --host host
Database host.
-p, --port port
Database port.
-U, --user user
Database username.
-d, --database name
Database name.
--read-only
Open connection in read-only mode.
-t, --theme theme
Color theme name.
--limit rows
Default result row limit.
--help
Display help information.
--version
Display version information.

KEYBOARD COMMANDS

Ctrl+Enter

Execute query.
Ctrl+j
Execute query (alternative).
Ctrl+o
Open query file.
Ctrl+s
Save query to file.
F1-F10
Switch between query tabs.
Ctrl+n
New query tab.
Ctrl+w
Close current tab.
Ctrl+e
Export results.
Ctrl+q
Quit.

CAVEATS

Some adapters require additional packages. Large result sets may impact terminal performance. Keyboard shortcuts may conflict with terminal emulator bindings. Features vary by adapter.

HISTORY

Harlequin was created by Ted Conbeer and first released in 2023. Built with Textual framework, it provides a modern terminal SQL experience. The project grew from frustration with CLI database tools lacking visual feedback. It emphasizes the DuckDB ecosystem while supporting traditional databases. Active development continues with new adapters and features.

SEE ALSO

duckdb(1), psql(1), mysql(1), sqlite3(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community