feat: add embedded chDB driver (driver: chdb) - #693
Open
wudidapaopao wants to merge 7 commits into
Open
Conversation
The macro rendered a schema-qualified DROP, which never matches a TEMPORARY table (they live outside databases), so temp tables were never dropped. Add an is_temporary branch emitting DROP TEMPORARY TABLE.
Run dbt against in-process chDB via clickhouse-connect 1.6.0's built-in chdb backend — no server or Docker, for CI and local development. Adds a chdb_path profile field and a dbt-clickhouse[chdb] extra; all dbt threads share one engine client (chDB is one engine per process). Cluster/replicated/distributed configs are rejected. Includes a chdb test profile (DBT_CH_TEST_DRIVER=chdb) and a no-Docker CI workflow.
wudidapaopao
force-pushed
the
chdb-driver
branch
from
July 27, 2026 13:22
464dddd to
6437df9
Compare
When the shared chdb engine is replaced by a different path, clear the process-wide server-state caches (ensured databases, capability probes) so the new engine is not judged by the previous one's state. Keeps the logic in the chdb module instead of dbclient.
…se on drop chDB is one engine per process. Instead of switching the shared engine (which left stale handles/caches), reject a second path with a clear error. Override database_dropped so a schema drop on one thread doesn't clear the shared client's default database for the others.
Author
|
Hi @BentsiLeviav @koletzilla, this revives #369. With the built-in Would appreciate a review when you have a chance. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 04c7679. Configure here.
The file merged in from main was not ruff-formatted (implicit string concatenation); ruff format joins it. Fixes the check-ruff-format CI step.
Replicated engines are written with arguments, e.g. Replicated('/path', ...),
so an exact '== Replicated' check missed them. Use a case-insensitive
substring match, matching relation.py's existing convention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds an experimental
driver: chdbthat runs dbt against chDB — ClickHouse as an in-process engine — with no server, Docker.Continues the work started in #369 and closes #297. It builds on clickhouse-connect's pluggable backend (ClickHouse/clickhouse-connect#872, released in 1.6.0), which exposes the chDB engine behind
get_client(interface="chdb")— so the driver reuses the existing HTTP client surface and only changes how the connection is created.Also fixes
clickhouse__drop_relationso it drops temporary tables. This affects all drivers.Usage
pip install "dbt-clickhouse[chdb]"The embedded engine is single-node, so
cluster,cluster_mode,Replicated, and the distributed materializations are rejected. The full integration suite runs against the driver in a new no-Docker CI job (DBT_CH_TEST_DRIVER=chdb).Checklist