hazine
hazine runs a DuckDB server that speaks the Quack protocol, for a DuckLake catalog, on localhost only. Clients reach it through an SSH tunnel.
It follows the pattern of DuckDB's own Quack deployment
(duckdb-quack-infra): the
DuckDB CLI runs an init file that ends in quack_serve, and keeps serving for
as long as its stdin stays open. hazine replaces sleep infinity | duckdb -init init.sql with a supervisor that:
- refuses any non-loopback listen address,
- checks that the CLI is DuckDB 2.0 or later,
- holds DuckDB's stdin open, and closes it to stop DuckDB cleanly on SIGTERM
(killing it after
--stop-timeout), - forwards DuckDB's output to its log (text or JSON), with
QUACK_TOKENredacted, - restarts DuckDB with backoff, and exits non-zero after
--max-failuresfailed starts in a row, so systemd sees the failure.
nginx and TLS are not needed: the SSH tunnel provides authentication and encryption, and Quack checks a token on top.
Requirements
- DuckDB CLI ≥ 2.0 with the
quackextension:duckdb -c "INSTALL quack;" - Rust ≥ 1.85 to build
Server setup
&&
Edit /etc/hazine/init.sql to change the resource settings and the DuckLake
attach. Keep the final quack_serve call: it listens on
getenv('HAZINE_QUACK_ADDR'), and it selects only listen_uri, listen_url so
that the token is not printed.
Connecting
LOAD quack;
FROM quack_query('quack:127.0.0.1:1294', 'SELECT 42',
token = '<QUACK_TOKEN>', disable_ssl = true);
Configuration
Precedence: flags > environment > defaults. See hazine serve --help.
| Flag | Environment | Default |
|---|---|---|
--duckdb |
HAZINE_DUCKDB |
duckdb (from PATH) |
--init |
HAZINE_INIT |
/etc/hazine/init.sql |
--database |
HAZINE_DATABASE |
in memory |
--quack-addr |
HAZINE_QUACK_ADDR |
127.0.0.1:1294 |
--ready-timeout |
HAZINE_READY_TIMEOUT |
60 seconds |
--stop-timeout |
HAZINE_STOP_TIMEOUT |
30 seconds |
--max-failures |
HAZINE_MAX_FAILURES |
5 |
--log-format |
HAZINE_LOG_FORMAT |
text (or json) |
The log level comes from RUST_LOG (default info).
License
MIT