Moose OLAP
Moose OLAP is MooseStack's schema-as-code layer for ClickHouse. It turns tables, views, and materialized views into typed objects your app can read from, write to, and evolve in code.
app/table.ts
import { OlapTable, ClickHouseEngines, LifeCycle } from "@514labs/moose-lib"; interface Record { id: string; name: string; timestamp: Date;} export const table = new OlapTable<Record>("table", { engine: ClickHouseEngines.MergeTree, orderByFields: ["id"], version: "0.0", lifeCycle: LifeCycle.FULLY_MANAGED,});Define your schema
- Define tables in TypeScript or Python
- Shape and precompute data with views and materialized views
Evolve or adopt an existing schema
- Carry local schema changes forward to staging and production environments with schema migrations during development and planned migrations for remote environments
- Work with existing ClickHouse tables and pull those schemas into your project when Moose is not the only system managing them
Read and write data
- Query data from your application code or APIs through typed table and view objects
- Insert data for ingestion flows, backfills, or batch writes
Get started
Choose the path that matches whether you're connecting to an existing ClickHouse deployment or starting a new Moose project.
Use existing ClickHouse
Connect Moose to your current ClickHouse setup and generate typed models around the schema you already have.
Open the guide →
Start from scratch
Define tables in TypeScript or Python and let Moose manage the ClickHouse schema lifecycle.
Model tables →
OLAP is usually already enabled
Most templates enable OLAP by default. If you have disabled it, turn features.olap back on in moose.config.toml before modeling tables or applying OLAP migrations.