Skip to content

feat: add native TCP client alongside HTTP - #354

Draft
simPod wants to merge 1 commit into
masterfrom
feat/native-tcp
Draft

simPod wants to merge 1 commit into
masterfrom
feat/native-tcp

Conversation

@simPod

@simPod simPod commented Nov 23, 2026

Copy link
Copy Markdown
Owner

The HTTP client returns results in HTTP formats. Applications that need the native ClickHouse protocol currently have no client for it.

Add a separate synchronous TCP client with protocol revision negotiation, verified TLS, and a typed binary codec. It returns buffered results with column metadata and positional rows, and sends inserts in bounded blocks. The existing HTTP interfaces are unchanged.

Unsupported native types fail explicitly. The client does not retry inserts automatically when the server outcome is uncertain.

Context: HTTP format-based results cannot represent native TCP column blocks without conversion.
Decision: add a separate synchronous native client with revision negotiation, verified TLS, typed codecs, buffered results, and bounded row inserts; leave HTTP interfaces unchanged.
Consequences: callers use native column metadata and positional rows; unsupported types fail explicitly, and inserts are never retried automatically after an uncertain outcome.
@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.20551% with 142 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.94%. Comparing base (a48ea49) to head (89208fa).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/Client/Native/BinaryStream.php 0.00% 56 Missing ⚠️
src/Client/Native/Connection.php 78.80% 39 Missing ⚠️
src/Client/NativeClickHouseClient.php 87.94% 17 Missing ⚠️
src/Client/Native/ConnectionConfig.php 0.00% 12 Missing ⚠️
src/Client/Native/TypeCodec.php 96.99% 10 Missing ⚠️
src/Client/Native/DecodeBudget.php 0.00% 4 Missing ⚠️
src/Client/Native/Block.php 0.00% 1 Missing ⚠️
src/Client/Native/BlockCodec.php 98.41% 1 Missing ⚠️
src/Client/Native/Column.php 0.00% 1 Missing ⚠️
src/Client/Native/Result.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #354      +/-   ##
==========================================
- Coverage   96.43%   89.94%   -6.49%     
==========================================
  Files          43       54      +11     
  Lines         953     1751     +798     
==========================================
+ Hits          919     1575     +656     
- Misses         34      176     +142     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant