ClickHouse and dbt: Managing the Schema Layer
ClickHouse-specific decisions for a dbt project: MergeTree engine and ORDER BY on source tables, why changing ORDER BY rebuilds the table, schema-scope grants for dbt, and dimension data as code.
ClickHouse-specific decisions for a dbt project: MergeTree engine and ORDER BY on source tables, why changing ORDER BY rebuilds the table, schema-scope grants for dbt, and dimension data as code.
Define ClickHouse roles, users, and permissions as code. Atlas plans and applies changes automatically - no more manual GRANT/REVOKE drift.
Manage ClickHouse roles, users, and permissions through versioned migrations. Every security change goes through code review and CI before reaching production.
Manage ClickHouse schemas as code with Atlas. Inspect a live database, plan migrations automatically, and apply them declaratively or as versioned files.
Trace column-level data lineage across tables and views of your ClickHouse database. Visualize how columns are derived, inspect transformation expressions, and map upstream and downstream dependencies.
All common open-source relational database management systems are supported in all versions of Atlas.
Detect when a warehouse stops matching its checked-in schema while dbt keeps rebuilding models: what migrate status misses, how atlas schema diff reports drift, and what excluding dbt's database costs you.
This guide walks you through managing ClickHouse Cloud databases using Atlas, covering connection setup, development database considerations, and best practices for cloud environments.
Define ClickHouse named collections as code. Atlas inspects, plans, and applies CREATE/ALTER/DROP NAMED COLLECTION statements automatically.
Three ways to apply ClickHouse settings to Atlas operations: a settings profile for the Atlas user, connection URL parameters, or settings in migration files.
Define ClickHouse WASM modules and WASM user defined functions as code. Atlas inspects, plans, and applies the SQL to create them automatically.
Manage schema changes on a ClickHouse cluster with Atlas: run a clustered dev database, enable ON CLUSTER, and handle replicated and distributed table engines.
Define ClickHouse lookup tables and seed data as code. Atlas computes INSERT, ALTER UPDATE, and ALTER DELETE statements automatically.
Which ALTER statements rewrite data on a large warehouse table, which ones are metadata-only, and how to block a destructive change with Atlas lint and a pre-migration check.
Manage the schema layer a dbt project runs on with Atlas: databases, source tables, lookup data, roles and grants, with dbt's own models left to dbt through exclude patterns in atlas.hcl.
Atlas provides comprehensive support for managing ClickHouse database objects using HCL schema definitions. Below is an overview of the objects you can manage.
Use the sql() function in a ClickHouse HCL schema for engines that take parameters, replicated and distributed tables, column defaults, and TTL expressions.