moondb

waning crescent · a statute of moondb

moonchdb

The ClickHouse implementation of the AsyncDriver contract — the HTTP interface, RowBinary results read in their own bytes, and parameters the server substitutes.

Enactment

What it is

moonchdb connects to a ClickHouse server over its HTTP interface and implements AsyncDriver against it. One statement is one request: the query is the body, the bound values travel beside it as URL parameters, and the answer comes back as RowBinaryWithNamesAndTypes.

i

Install

moon add moonbitstack/moonchdb

ii

Placeholder

A statement is written with ?; the driver rewrites each one into the server's {p1:Int32} syntax, choosing the type from the bound Value, and passes the value as param_p1. Nothing is spliced into the SQL text, so a literal, an identifier and a comment are left alone.

iii

Results

The format is binary, not text: a column count, the names, the type strings, then one row after another. A 64-bit integer, a decimal and a byte string keep their exact value; a String column reads back as Text when its bytes are UTF-8 and as Blob when they are not.

iv

What an analytical engine lacks

No transactions, no savepoints, no server-side cursor, no prepared statements and no unique constraints. The driver reports that through capabilities — transactions is false — so a query layer lowers its plan instead of discovering it mid-statement.

v

Coverage

execute query close dialect parameters RowBinary arrays and nullable columns transactions (none) cursors (none) ping (default).

moonchdb implements AsyncDriver placeholder ? → {p1:Type} interface HTTP
See the family The contract it obeys