Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 5 min read How-to mediumAdept

Manage your ClickHouse Schema-as-Code using Atlas

Atlas, an open-core Database Schema-as-Code tool, now supports ClickHouse, letting engineers declare the desired schema in a SQL file and have the tool inspect the live database, diff it, and generate the DDL migration plan automatically. Unlike ORM-level migration generators such as Django's, which are tied to one stack and only cover tables, columns and indexes, this declarative approach works generically and can manage objects like views and materialized views. A walkthrough runs ClickHouse in Docker, applies a MergeTree table with `atlas schema apply` using a dev database URL, confirms the schema is synced, and then adds a column, which Atlas turns into an ALTER TABLE statement.

Related posts

  • Declarative Schemas for Simpler Database Management

    Supabase mediumAdept

    Supabase CLI now supports declarative schemas: the desired final state of Postgres tables, views, functions, RLS policies, grants and types lives in versioned .sql files, and a schema diff tool such as migra generates the migration files. Supabase used this internally for two years on its complex projects table, which sits in a private schema behind a public view with RLS-based ABAC and INSTEAD OF triggers. Previously, adding one column meant hand-copying view and trigger definitions into a migration of several hundred lines that conflicted often. Now it is a one-line diff, and generated migrations still get manual review. The team says this cut schema changes from hours to minutes and made rebasing much easier.

  • clickhouse.build: An agentic CLI to accelerate Postgres apps with ClickHouse

    ClickHouse mediumAdept

    clickhouse.build is an open source agentic CLI that adds ClickHouse to Postgres-backed TypeScript apps for analytical queries while leaving transactional work in Postgres. A scanner agent finds analytical queries in raw SQL, Prisma or Drizzle code. A data migrator then generates ClickPipes Postgres CDC API calls to sync the needed tables. A code migrator, checked by a QA sub-agent against reference codebases, rewrites queries behind a strategy pattern toggled by a USE_CLICKHOUSE feature flag. The workflow keeps a human in the loop to approve each change and aims to produce a backwards-compatible proof of concept in under an hour.

  • The official ClickHouse provider for Apache Airflow is now available

    ClickHouse mediumAdept

    Apache Airflow now ships an official upstream ClickHouse provider, apache-airflow-providers-clickhousedb, built on the clickhouse-connect Python client over HTTP(S). It plugs into Airflow's common SQL framework so the standard SQLExecuteQueryOperator handles DDL, DML and queries, and adds a ClickHouseHook for bulk columnar inserts and other client-specific calls. Setup takes a pip install, a clickhouse connection (port 8443 with secure=true for TLS or ClickHouse Cloud) and an ordinary DAG, and the same project runs locally via the Astro CLI and deploys unchanged to Astronomer. It replaces the community airflow-clickhouse-plugin as the supported path, and migration is described as mostly mechanical.

  • What's new in ClickStack. July '25.

    ClickHouse mediumAdept

    ClickStack, ClickHouse's open-source observability stack, adds beta support for ClickHouse's native JSON column type for OpenTelemetry attribute columns in place of Map. Map stored every value as a string, forced full-column scans to read one key and stringified nested data. JSON stores each path as a typed sub-column, which removes the need for bloom filters on map keys and values. On a ~90M-row log dataset, a per-pod aggregation ran 9x faster and read over 10x less data. Support needed changes to clickhouse-go, the OTel exporter (behind a feature gate) and HyperDX's UI, and the new schema is incompatible with the Map schema, so existing data must be migrated via INSERT INTO ... SELECT or kept in a separate source.

  • ClickHouse and dbt - A Gift from the Community

    ClickHouse mediumAdept

    The dbt-clickhouse adapter, started by community contributor Dmitriy Sokolov and later taken over as a vendor-supported plugin, maps dbt's view, table, incremental and ephemeral materializations onto ClickHouse features. The default incremental strategy builds a temporary table of changed rows, copies all unchanged rows into a new table and atomically swaps it in, which duplicates the whole dataset on every run. A newer delete+insert strategy uses ClickHouse 22.8's experimental lightweight deletes (tombstones removed during merges) to write only the changed rows and performs significantly better. Its caveats: it needs the experimental setting enabled, and because it modifies the target table directly with no transaction, a failure can leave the model in an invalid state.

The quest for software engineering knowledge.

Look:
Layout: