Quarry: a TypeScript query builder for ClickHouse with schema-aware types
The author has released Quarry, an open-source query builder for ClickHouse written in TypeScript and already used at Bold.org. It is inspired by Kysely, which the team uses with PostgreSQL, but adds first-class typed support for ClickHouse features such as FINAL, PREWHERE, ARRAY JOIN and ClickHouse aggregates. Queries are built with immutable, schema-derived types that follow the driver's actual return values, including UInt64 counts serialized as strings. Existing SQL can remain on the official client, a .toSQL() method exposes generated SQL, and an experimental CLI generates type definitions from existing tables. The project is at version 0.10.0, so minor releases may still change the API, and the maintainers are asking for real-world examples where it falls short.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in