Skip to main content

The SQL IDE for Your Terminal.

Project description

Harlequin

PyPI

PyPI - Python Version Runs on Linux | MacOS | Windows

The SQL IDE for Your Terminal.

Harlequin

[!TIP] This README contains a small subset of the docs available at harlequin.sh.

Installing Harlequin

Harlequin is a Python program, and there are many ways to install and run it. We strongly recommend using uv:

  1. Install uv. From a POSIX shell, run:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    

    Or using Windows Powershell:

    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    
  2. Install Harlequin as a tool using uv:

    uv tool install harlequin
    

    This command will install Harlequin into an isolated environment and add it to your PATH so you can easily run the executable.

Other Installation Methods

Alternatively, if you know what you're doing, after installing Python 3.9 or above, install Harlequin using pip, pipx, poetry, or any other program that can install Python packages from PyPI:

pip install harlequin

There is also a Homebrew formula for Harlequin, although this is maintained by the community and is not as rigorously tested as the Python installations. Note that the formula includes several Harlequin adapter packages (Postgres, MySQL/MariaDB, and ODBC) and their dependencies, which is convenient but increases the application size.

brew install harlequin

Installing Database Adapters

Harlequin can connect to dozens of databases using adapter plug-ins. Adapters are distributed as their own Python packages that need to be installed into the same environment as Harlequin.

For a list of known adapters provided either by the Harlequin maintainers or the broader community, see the adapters page.

The adapter docs also include installation instructions. Some adapters can be installed as Harlequin extras, like postgres. If you used uv to install Harlequin:

uv tool install 'harlequin[postgres]'

You can install multiple extras:

uv tool install 'harlequin[postgres,mysql,s3]'

Running Harlequin

Once Harlequin is installed, you run it from the command line. The arguments and options you pass in at the command line affect Harlequin's behavior, like what database adapter it uses, which database it connects to, whether or not the file picker is visible, and more. Assuming you have installed Harlequin so that it is on your PATH (uv tool install harlequin does this automatically), you run Harlequin by typing a command of this form into your shell:

harlequin [OPTIONS] [CONN_STR]

where [OPTIONS] is 0 or more pairs of the form --[option-name] [option-value], and [CONN_STR] is 0 or more connection strings. [OPTIONS] are composed of both Harlequin options and adapter options. For a full list of options, run Harlequin with the --help option:

harlequin --help

Using Harlequin with DuckDB

Harlequin defaults to using its DuckDB database adapter, which ships with Harlequin and includes the full DuckDB in-process database.

To open an in-memory DuckDB session, run Harlequin with no arguments:

harlequin

To open one or more DuckDB database files, pass in relative or absolute paths as connection strings (Harlequin will create DuckDB databases if they do not exist):

harlequin "path/to/duck.db" "another_duck.db"

If you want to control the version of DuckDB that Harlequin uses, see the Troubleshooting page.

Using Harlequin with SQLite and Other Adapters

Harlequin also ships with a SQLite3 adapter. To use that adapter, you specify the --adapter sqlite option. Like DuckDB, you can open an in-memory SQLite database by omitting the connection string:

harlequin --adapter sqlite

You can open one or more SQLite database files by passing in their paths as connection strings; note that the --adapter option has a short alias, -a:

harlequin -a sqlite "path/to/sqlite.db" "another_sqlite.db"

Other adapters can be installed as plug-ins; for more information, see the installation guide, and the guides for individual adapters. Each adapter can define its own options, which you can view using harlequin --help.

Configuring Harlequin

Harlequin contains a large number of options that allow you to set the theme, customize key bindings, show remote and local files, set the locale for number formatting, and much more. These can always be entered at the command line, but it can be convenient to define a configuration as a profile instead. For more information on configuring Harlequin, see Using Config Files.

Using Harlequin with Django

django-harlequin provides a command to launch Harlequin using Django’s database configuration, like:

./manage.py harlequin

Keep Reading at harlequin.sh

Visit harlequin.sh for an overview of features and full documentation, starting with a guided walkthrough of how to edit and execute queries, use the data catalog, export data, and more.

Getting Help

To view all command-line options for Harlequin and all installed adapters, after installation, simply type:

harlequin --help

To view a subset of these docs (and a link back here) from within the app, press F1.

See the Troubleshooting guide for help with key bindings, appearance issues, copy-paste, etc.

GitHub Discussions are a good place to ask questions, request features, and say hello.

GitHub Issues are the best place to report bugs.

Sponsoring Harlequin

Please consider sponsoring Harlequin's author, so he can continue to dedicate time to Harlequin.

Contributing

Thanks for your interest in Harlequin! Harlequin is primarily maintained by Ted Conbeer, but he welcomes all contributions!

Please see CONTRIBUTING.md for more information.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

harlequin-2.5.1.tar.gz (108.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

harlequin-2.5.1-py3-none-any.whl (118.1 kB view details)

Uploaded Python 3

File details

Details for the file harlequin-2.5.1.tar.gz.

File metadata

  • Download URL: harlequin-2.5.1.tar.gz
  • Upload date:
  • Size: 108.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for harlequin-2.5.1.tar.gz
Algorithm Hash digest
SHA256 8e9dc29df55a7cb546fdbc9999b3df365f825cba537d98160644225a7b1d0d57
MD5 e69b79d11e2f3358617b1625cd55dabc
BLAKE2b-256 f6333e7ce0ce003a940932219028706d950f2098e35018e10b00097aa90c3ae5

See more details on using hashes here.

Provenance

The following attestation bundles were made for harlequin-2.5.1.tar.gz:

Publisher: publish.yml on tconbeer/harlequin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file harlequin-2.5.1-py3-none-any.whl.

File metadata

  • Download URL: harlequin-2.5.1-py3-none-any.whl
  • Upload date:
  • Size: 118.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for harlequin-2.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e41e40ccc8b6cf29ef794d69dd1a505e69ff1b8b64358f4ee1d885ba3d71357
MD5 b5b7e3e92092f50d1b33a258082a8585
BLAKE2b-256 607cde4598da302670f62883a640f05e3758084338be3e654b3a32d99076ca49

See more details on using hashes here.

Provenance

The following attestation bundles were made for harlequin-2.5.1-py3-none-any.whl:

Publisher: publish.yml on tconbeer/harlequin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page