Skip to content

Support change database and raw queries - #72

Merged
abonander merged 3 commits into
mainfrom
support-database-change-and-raw-queries
Aug 31, 2026
Merged

Support change database and raw queries#72
abonander merged 3 commits into
mainfrom
support-database-change-and-raw-queries

Conversation

@koletzilla

@koletzilla koletzilla commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Changes

Updated clickhouse to 0.15.2

The new release adds Client::query_raw() and support for the database URL parameter, which this PR builds on.

Send SQL verbatim (closes #53)

The SQL set on a statement is now sent to the server exactly as written. Parameters were always bound server-side with {name: Type}, and that still works the same way.

Configurable default database (closes #67)

There are two ways to set the default database:

  • Add ?database=<name> to the URI to set it for all connections created from a Database.
  • Use the standard ADBC option "adbc.connection.db_schema" (OptionConnection::CurrentSchema) to set or override it per connection, at creation or later. The same option reads it back. In ADBC terms a ClickHouse database maps to a schema, since ClickHouse has no catalogs.

The database name travels with every HTTP request, so it is not affected by session expiry or load balancing, unlike a USE <name> statement.

Empty database names are rejected with a clear error instead of being silently ignored.

@koletzilla
koletzilla force-pushed the support-database-change-and-raw-queries branch from a5de3d2 to 5cbd3af Compare August 31, 2026 11:03
@koletzilla
koletzilla marked this pull request as ready for review August 31, 2026 11:07
@koletzilla
koletzilla requested a review from abonander as a code owner August 31, 2026 11:07
@koletzilla
koletzilla force-pushed the support-database-change-and-raw-queries branch from fbd8d45 to e64d323 Compare August 31, 2026 15:33
@abonander
abonander merged commit 69523a7 into main Aug 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow configuring a different database for the connection Don't try to substitute ? in queries

2 participants