Skip to content

Conversation

@alex-clickhouse
Copy link
Collaborator

@alex-clickhouse alex-clickhouse commented Feb 10, 2026

Creates a new class ClickHouseClient that is intended as the primary way of interacting with the database.

Existing ADO.NET functionality now acts as a wrapper around ClickHouseClient, and there should be no breaking changes in terms of their behavior.

Examples and docs updated accordingly.


Note

Medium Risk
Core connection/command execution paths and resource-ownership/disposal semantics were refactored to route through ClickHouseClient, which could introduce subtle behavioral differences (headers, sessions, database selection, logging) despite extensive test updates.

Overview
Refactors the driver so ClickHouseClient becomes the primary execution/HTTP/logging surface, and the ADO.NET layer (ClickHouseConnection/ClickHouseCommand) now delegates query execution and streaming to an internal/shared client.

This shifts ownership semantics (connections may own or share a client), makes ChangeDatabase connection-scoped (without mutating shared client settings), and removes connection-level implementations of PingAsync, JSON type registration, header-building, and stream insert in favor of client equivalents.

Tests are reorganized accordingly: large new coverage for QueryOptions/InsertOptions, moved validation and redaction checks to ClickHouseClient tests, updated logging assertions to ClickHouseLogCategories.Client, and adjusted CI ClickHouse setup to use install/start on macOS/Windows. Public surface also changes with ClickHouseParameterCollection becoming public, and the project drops PublicAPI analyzer wiring from the csproj.

Written by Cursor Bugbot for commit 321ad52. This will update automatically on new commits. Configure here.

* ClickHouseClient skeleton

* null checks

* remove parameter

* No insert parallelism by default

* fix UseSession override

* Add Timeout to QueryOptions

* Adjust xml comment

* Adjust InsertRawStreamAsync for backwards compatibility
* Move ClickHouseConnection logic to Client

* update example

* fix logging tests

* Update client reference when command has its connection changed

* fix role override

* Isolate database changes to connection

* datasource adjustments around disposal

* remove unused usings

* Don't dispose response in PostStreamAsync

* ExecuteRawResultAsync implementation
…lickHouseClient (#209)

* move binary insert functionality from BulkCopy to ClickHouseClient

* Magic numbers to consts

* fix batch insert issues
* examples updates

* FINAL performance link
* disable obsolete warnings in tests using BulkCopy

* CLAUDE.md update

* examples readme update

* release notes update
@alex-clickhouse alex-clickhouse marked this pull request as ready for review February 10, 2026 13:29
@alex-clickhouse
Copy link
Collaborator Author

Cloud test failures are a cloud issue, not a client issue

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@alex-clickhouse alex-clickhouse merged commit e3f2605 into main Feb 12, 2026
17 of 18 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.

2 participants