harlequin-h2
A Harlequin adapter for H2 databases via JDBC. It supports embedded file and memory databases as well as H2 TCP and TLS servers.
The adapter embeds the JVM with JPype and talks to H2 directly. File and memory connections do not require a database server, protocol bridge, or fixed port.
Requirements
- Python 3.10 or later
- Harlequin 2.9 or later, below 3.0
- H2 2.x
- A Java runtime compatible with your H2 version
- The H2 JDBC driver JAR
Installation
Install H2 and add this adapter to the same environment as Harlequin:
brew install h2
uv tool install harlequin --with harlequin-h2
If Harlequin is already installed with uv, add the adapter to that tool
environment:
uv tool install harlequin --with harlequin-h2 --force
The adapter finds Homebrew's H2 JAR automatically. On other platforms, pass
--jar or set H2_JAR:
export H2_JAR=/path/to/h2.jar
Usage
Embedded file database
harlequin -a h2 -U sa \
"jdbc:h2:file:/absolute/path/to/database;AUTO_SERVER=TRUE;IFEXISTS=TRUE"
AUTO_SERVER=TRUE allows Harlequin and another JVM process to share the file.
Use IFEXISTS=TRUE when inspection must never create a new empty database due
to a mistyped path.
Embedded memory database
harlequin -a h2 "jdbc:h2:mem:demo"
A named embedded memory database normally exists until its last connection is
closed. Add ;DB_CLOSE_DELAY=-1 only when it must survive connection closure;
H2 then retains it until SHUTDOWN or process exit.
TCP or TLS server
harlequin -a h2 -U sa "jdbc:h2:tcp://localhost/~/demo"
harlequin -a h2 -U sa "jdbc:h2:ssl://db.example.com/~/demo"
Options
| Option | Description |
|---|---|
--jar PATH |
Path to the H2 JDBC driver JAR |
-U, --user USER |
H2 username; defaults to sa |
--password PASSWORD |
H2 password; defaults to an empty string |
Prefer a protected Harlequin profile or an environment-variable reference for passwords. Command-line arguments may be visible to other local processes. Harlequin 2.10 and later also mask this option in configuration output and prompts.
Environment variables in the JDBC URL are expanded before connecting:
export H2_DATABASE_DIR=/absolute/path/to/databases
harlequin -a h2 'jdbc:h2:file:$H2_DATABASE_DIR/demo;IFEXISTS=TRUE'
Features
- Query execution and result display
- Lazy schema, table, view, and column catalog
- Data preview, column insertion, relation description, and DDL actions
- Safe query execution and result fetching across Harlequin worker threads
License
MIT
Metadata
Release files for harlequin-h2 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| harlequin_h2-0.1.1.tar.gz | 10.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| harlequin_h2-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.2 kB
Release files / harlequin_h2-0.1.1.tar.gz
| Download URL | harlequin_h2-0.1.1.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2efcc82f71ee14b58b58861b979a75a1359685c408222ea4ec9dcb53b7716fb3
|
|
BLAKE2b-256 checksum How to use checksums |
78598c02164eb89c9823b56940bf7dea45dc87d8ba042d0c8c5baf3d1af2f239
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / harlequin_h2-0.1.1-py3-none-any.whl
| Download URL | harlequin_h2-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c456dd280f882f5242f665c8886a904db38246a9e00d10f9aa2ae034d51f3835
|
|
BLAKE2b-256 checksum How to use checksums |
ac81bbf9ea4eff37d3790ffd42d8530d8a1b4f6548c5f30bfd3d9ce9f5782ae5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency log