Guide
ClickHouse + Bruin 101
Initialize Bruin's ClickHouse template, then learn what every asset does - from governed seed data and SQL materializations to PostgreSQL replication, checks, tests, and lineage.
The whole project is one command. Run it, point your coding agent at the Bruin MCP, and it can configure and run everything itself.
$ bruin init clickhouseThree ways to go from here:
- Self-service it. Let the agent configure and run the whole thing, and ask it questions as you go.
- Follow this tutorial. Slower, and it explains why each setting matters - the part an agent will not guess for you.
- Hand the tutorial to the agent. Point it at this page and have it work through the steps with you.
The template README is the short reference for everything it ships.
What
Use the current clickhouse template to build a small commerce pipeline in ClickHouse. The template is deliberately broad: it gives you versioned reference data, SQL and Python assets, several materialization strategies, a PostgreSQL ingestion branch, governance metadata, quality checks, a SQL unit test, and lineage in one project.
How
Start a local ClickHouse service and initialize the template. Then tour the assets in dependency order: reference and raw data first, then materializations, Python, and the optional PostgreSQL branch. Finish by validating, running the deterministic core, and querying the serving layer. If you want the generic template workflow first, see Using Bruin Templates.
Before you start
- Bruin CLI installed
- A local ClickHouse Docker container or a non-production ClickHouse service you can write to
Guide overview
- 1Initialize & Connect ClickHouseScaffold the template, then connect it to ClickHouse Cloud or a local Docker instance.
- 2Read the Reference & Raw AssetsSee how the template models CSV reference data, ClickHouse DDL, and governed raw tables.
- 3Follow the MaterializationsTrace the core graph and learn the table and view strategies used in the template.
- 4Add Python & PostgreSQL IngestionUnderstand the code-managed reference table and optional source, sensor, Ingestr, and view branch.
- 5Validate Quality, Tests & LineageUse the template’s contracts, checks, unit test, and graph before scheduling it.
- 6Run & Query the ShowcaseRun the deterministic core, use targeted incremental commands, and inspect the serving models.
Resources
Get help & contribute