Skip to content

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

ClickHouse 9 min read Announcement mediumAdept

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

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.

Related posts

  • Agentic coding with ClickHouse. One person, one data stack, one full-stack application

    ClickHouse easyNovice

    A ClickHouse Solutions Architect with no frontend or backend background built ClickShop, a full-stack retail analytics demo, in a couple of days using Cursor. The stack uses Next.js on Vercel with per-persona workspaces, PostgreSQL for transactions synced to ClickHouse via ClickPipes CDC, and a Bronze/Silver/Gold medallion layout built on materialized views. On top sit 18 LibreChat agents, plus two observability layers: Langfuse for LLM tracing and cost, and ClickStack over OpenTelemetry for infrastructure. Open source components, Cursor skills and MCP database connectors reduce AI guesswork, though iteration, review and token costs remain significant.

  • Introducing pg_clickhouse: A Postgres extension for querying ClickHouse

    ClickHouse mediumAdept

    pg_clickhouse v0.1.0 is an Apache 2-licensed PostgreSQL foreign data wrapper, derived from clickhouse_fdw, that runs analytics queries on ClickHouse from Postgres so existing queries can work unmodified by changing search_path. It modernizes the code with PGXS builds, CI across PostgreSQL 13-18 and ClickHouse 22-25, TLS, and Bool/Decimal/JSON types. Its main advance is pushdown: ordered-set aggregates like percentile_cont() are rewritten to ClickHouse quantile() and FILTER clauses become -If combinators. SEMI JOIN pushdown plus planner cost tuning brought 21 of 22 TPC-H queries under 1s, with 12 fully pushed down.

  • clickhousectl v0.2.0: Postgres, ClickPipes and more

    ClickHouse mediumAdept

    clickhousectl v0.2.0 adds Postgres management, both local (Docker-backed, keyed on name and major version 16–18) and as ClickHouse Cloud managed Postgres. It also adds ClickPipes commands for Kafka, Kinesis, object storage, CDC from Postgres/MySQL/MongoDB and BigQuery snapshots, plus SQL over HTTP through Query Endpoints so no local ClickHouse binary is needed. Query Endpoints are locked to a per-service API key whose only grant is a sql_console_admin binding, so a leaked key reaches one service only. Other changes include Markdown-style table output that uses fewer tokens for agents, a --debug flag for credential resolution, and a standalone typed async Rust crate, clickhouse-cloud-api.

  • A universal interface: How QuintoAndar made ClickHouse plug-and-play with managed Postgres

    ClickHouse easyNovice

    QuintoAndar's customer data platform replaced a Lambda architecture (a Postgres hot layer plus Kafka Connect into a Delta landing zone processed by 24/7 Databricks jobs with costly MERGE INTO deduplication) by having its event gateway write about 900 million monthly events directly into ClickHouse Cloud, which also serves roughly 300 million API requests a month with sub-second reads. Hightouch's Customer Studio doesn't support ClickHouse as a source, so the team put ClickHouse Managed Postgres in front of it. The pg_clickhouse extension exposes ClickHouse tables as foreign tables, pushes joins and aggregations down to ClickHouse, and keeps Hightouch's Lightning Sync state tables in Postgres. The team reports negligible overhead from the extra hop, and any Postgres-compatible tool can now reach ClickHouse.

  • PostgreSQL + ClickHouse as the Open Source unified data stack

    ClickHouse easyNovice

    An open source stack pairs PostgreSQL as the transactional system of record with ClickHouse for analytics, connected by PeerDB for change data capture and the pg_clickhouse extension, which transparently offloads analytical queries from Postgres to ClickHouse. Two patterns are described: CDC replication for operational analytics on application data, and split-writes for high-volume logs, metrics and events that never need to live in Postgres. Adopting it involves creating a ClickHouse database, replicating via PeerDB, configuring pg_clickhouse and pointing queries at its tables, so application changes stay minimal. A managed version in ClickHouse Cloud swaps PeerDB for ClickPipes and preinstalls the extension.

The quest for software engineering knowledge.

Look:
Layout: