harlequin

repository·main·Indexed 27 days ago

https://github.com/tconbeer/harlequin

A terminal-based SQL IDE that allows users to connect to various databases via pluggable adapters. It features a data catalog, query editor, and results viewer, with built-in support for DuckDB and SQLite, and optional adapters for Postgres, MySQL/MariaDB, and ODBC. Version 2.5.2.

Tokens
3.2K
Snippets
9
Records
30
Agent score
91%

What's inside harlequin

  1. Install Harlequin using uv

    main

    The recommended way to install Harlequin is using uv. This installs Harlequin into an isolated environment and adds the executable to your PATH.

    1. Install uv first:

      • POSIX (Linux/macOS): curl -LsSf https://astral.sh/uv/install.sh | sh
      • Windows (PowerShell): powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    2. Install Harlequin:

      uv tool install harlequin
    curl -LsSf https://astral.sh/uv/install.sh | sh
    # then
    uv tool install harlequin
  2. Install Harlequin via pip or Homebrew

    main

    If you prefer not to use uv, you can install Harlequin using standard Python package managers or Homebrew.

    Using pip:

    pip install harlequin

    Using Homebrew (macOS): Note that the Homebrew formula includes several adapter packages (Postgres, MySQL/MariaDB, and ODBC) which increases the application size.

    brew install harlequin
    pip install harlequin
    # or
    brew install harlequin
  3. Install Database Adapters

    main

    Harlequin uses adapter plug-ins to connect to different databases. Adapters must be installed into the same environment as Harlequin.

    If you used uv to install Harlequin, you can install adapters as 'extras'.

    Install a single adapter (e.g., postgres):

    uv tool install 'harlequin[postgres]'

    Install multiple adapters:

    uv tool install 'harlequin[postgres,mysql,s3]'
  4. Use Harlequin with SQLite

    main

    To use the SQLite3 adapter, use the --adapter option (or its short alias -a).

    Open an in-memory SQLite database:

    harlequin --adapter sqlite

    Open specific SQLite database files:

    harlequin -a sqlite "path/to/sqlite.db" "another_sqlite.db"
    harlequin -a sqlite "path/to/sqlite.db"
  5. Use Harlequin with DuckDB

    main

    Harlequin uses the DuckDB adapter by default.

    Open an in-memory DuckDB session:

    harlequin

    Open specific DuckDB database files: Pass the paths as connection strings. Harlequin will create the databases if they do not exist.

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