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.10 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.
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file harlequin_h2-0.1.0.tar.gz.
File metadata
- Download URL: harlequin_h2-0.1.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
174b6274f73af8328b6f38d88e294ed73ec67fddc74b032d52ad7bbe8d37ef5b
|
|
| MD5 |
2d93d7c8b210eb257ccb7c0bae132139
|
|
| BLAKE2b-256 |
87591d7330372991356a88bcbd5d5875a602112c6c2e82a1cd4a359e6e9c5693
|
Provenance
The following attestation bundles were made for harlequin_h2-0.1.0.tar.gz:
Publisher:
publish.yml on clang-engineer/harlequin-h2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
harlequin_h2-0.1.0.tar.gz -
Subject digest:
174b6274f73af8328b6f38d88e294ed73ec67fddc74b032d52ad7bbe8d37ef5b - Sigstore transparency entry: 2657750992
- Sigstore integration time:
-
Permalink:
clang-engineer/harlequin-h2@6e9b20e0285d93578ab10a153a25f78dba83779e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/clang-engineer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6e9b20e0285d93578ab10a153a25f78dba83779e -
Trigger Event:
release
-
Statement type:
File details
Details for the file harlequin_h2-0.1.0-py3-none-any.whl.
File metadata
- Download URL: harlequin_h2-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e3a35698b42644112d5aee72d171e6c0029b7f8f96b1679c55050ab637b480e
|
|
| MD5 |
ae4cb76d1f7331b505a954879eb3844f
|
|
| BLAKE2b-256 |
1cfed853bcacea8d2186923a7db063703401b39f212be3a3e8fc199698e5741f
|
Provenance
The following attestation bundles were made for harlequin_h2-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on clang-engineer/harlequin-h2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
harlequin_h2-0.1.0-py3-none-any.whl -
Subject digest:
6e3a35698b42644112d5aee72d171e6c0029b7f8f96b1679c55050ab637b480e - Sigstore transparency entry: 2657751034
- Sigstore integration time:
-
Permalink:
clang-engineer/harlequin-h2@6e9b20e0285d93578ab10a153a25f78dba83779e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/clang-engineer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6e9b20e0285d93578ab10a153a25f78dba83779e -
Trigger Event:
release
-
Statement type: