Alpha

Quarry

A ClickHouse-native query builder for TypeScript. Type-safe, explicit about ClickHouse semantics, and honest about what your driver actually returns at runtime.

Install and query
pnpm add quarry @clickhouse/client

const rows = await db
  .selectFrom("events as e")
  .selectExpr((eb) => ["e.user_id", eb.fn.count().as("events")])
  .groupBy("e.user_id")
  .execute();

Native parameters

Values compile to ClickHouse query_params instead of being interpolated into SQL.

Runtime-honest types

UInt64, Decimal, nullable values, and aggregates are typed as the driver returns them.

Just a query builder

No ORM, migrations, entities, or generic SQL dialect hiding ClickHouse semantics.

Need the deeper model?

Quarry is explicit about ClickHouse behavior. If you want to see where the design is headed or why the semantics look the way they do, the deep-dive docs are the next stop.