The ClickHouse TypeScript Type Problem (And How to Actually Fix It)
ClickHouse and TypeScript often disagree about what types come back at runtime. Learn the real mappings for DateTime, UInt64, Nullable, Decimal, and more.
Insights
Deep dives, architecture notes, and product guidance from the hypequery team.
ClickHouse and TypeScript often disagree about what types come back at runtime. Learn the real mappings for DateTime, UInt64, Nullable, Decimal, and more.
ClickHouse solved fast analytics reads. It did not solve how the rest of your product should call those queries safely. This post argues for a typed analytics layer between raw SQL and every consumer.
Generate schema types from ClickHouse, define one typed query, and use it as the base for backend code, HTTP delivery, and React consumption.
Production patterns, performance pitfalls, and when to use something else. Learn how ClickHouse materialized views really work, how to choose the right engine, and when alternative patterns like projections make more sense.
Uber, Cloudflare, Instacart, GitLab, Lyft, Microsoft, and Contentsquare independently built near identical abstraction layers on top of ClickHouse. The shared architecture isn't coincidence, it is forced by the economics of making high performance schemas accessible at organisational scale.
Schema drift is where many ClickHouse TypeScript codebases start to break. This post focuses on generated schema types and workflows that keep query code aligned with the live database.
A practical Next.js dashboard walkthrough: schema generation, shared backend queries, and a React consumption path that does not duplicate analytics logic.
Raw SQL plus hand-written row types leaves a blind spot in TypeScript applications. This post explains where that breaks down and what a safer query workflow looks like.