Overview

What is hypequery?

hypequery is a code-first analytics backend for ClickHouse, built for TypeScript teams who want scalable, type-safe analytics.

It lets you define queries in TypeScript, give them names, types, and schemas, and execute them anywhere they’re needed: inside backend services, background jobs, APIs, dashboards, or AI agents.

Instead of scattering SQL across applications, dashboards, and scripts, hypequery gives you a single, versioned place where analytics logic lives. In code.

hypequery is a library, not a hosted platform. It integrates directly with your existing ClickHouse setup and runs wherever your application runs.

Ready to get started?

Start building type-safe analytics in minutes.

Get Started

Core primitives

hypequery provides a small set of opt-in building blocks:

  • Code-first metric and query definitions — Define named analytics in TypeScript with explicit inputs, outputs, and metadata.

  • Type-safe query building for ClickHouse — Compose queries programmatically without string-building SQL.

  • Embedded execution — Run analytics directly in-process using api.run(). No HTTP required.

  • Optional HTTP & OpenAPI exposure — Expose the same definitions as APIs when needed, with generated OpenAPI specs.

  • React hooks — Generate TanStack Query hooks (useQuery, useMutation) straight from your serve.define catalog for type-safe UI consumption.

Each primitive can be used independently. There is no required runtime, server, or hosted service.

Use Cases

Backend & platform teams

Define analytics once and reuse them across services, cron jobs, background workers, and internal tools, without copying SQL or re-implementing logic.

Dashboards

Expose a small, trusted set of metrics to dashboards instead of letting each chart redefine business logic.

AI agents & automation

Give agents structured, discoverable analytics with typed inputs and outputs. Not raw SQL strings or brittle prompts.

Data teams on ClickHouse

Keep ClickHouse fast and flexible while managing analytics logic in code, under version control, with clear ownership.

Multi-tenancy SAAS apps

Query endpoints automatically generated with tenant context for analytical SAAS apps with data level security


Next Steps

Continue: Why hypequery? - Understand the problems hypequery solves

Or jump to: Installation Options