Quarry
Concepts

Concepts

Background reading on what Quarry is, why it exists, and how it behaves at runtime.

These pages explain the design choices behind Quarry. They are background reading rather than reference material, and they should help you understand why the API looks the way it does.

  • Approach — what Quarry is and is not, and why it is not a Kysely dialect or Drizzle adapter.
  • Architecture — the four-stage pipeline from chained builder calls to ClickHouse SQL, and where to read the source if you want to go deeper.
  • Scopes and aliases — how Quarry tracks which columns are in scope at every step of a chained query, and the rules around selectAll() and column references.
  • ClickHouse quirks — a supported clauses matrix, plus the ClickHouse-specific behaviors you need to know about (LEFT JOIN nulls, PREWHERE, FINAL, typed parameters, ...).
  • Runtime semantics — the parts of ClickHouse you need to know about to read query results correctly.