Add InsertRawStreamAsync to connection for raw file inserts#130
Merged
alex-clickhouse merged 4 commits intomainfrom Dec 12, 2025
Merged
Add InsertRawStreamAsync to connection for raw file inserts#130alex-clickhouse merged 4 commits intomainfrom
alex-clickhouse merged 4 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new InsertRawStreamAsync method to ClickHouseConnection that enables direct insertion of raw data streams in various formats (CSV, JSON, Parquet, etc.) from files or memory, bypassing the ADO.NET parameter binding layer for bulk data loading scenarios.
Key Changes:
- New public API method
InsertRawStreamAsynconClickHouseConnectionwith support for custom formats, column specification, compression, and query ID tracking - Comprehensive test suite covering CSV, TSV, JSON formats with various compression and column specification scenarios
- Working example demonstrating file-based and memory-based stream insertion patterns
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| ClickHouse.Driver/ADO/ClickHouseConnection.cs | Implements InsertRawStreamAsync method with input validation, query construction, and HTTP streaming |
| ClickHouse.Driver.Tests/SQL/RawStreamInsertTests.cs | Comprehensive test suite covering multiple formats, compression modes, column specifications, and edge cases |
| ClickHouse.Driver.Tests/ADO/ConnectionTests.cs | Parameter validation tests ensuring proper exception handling for null/empty inputs |
| examples/Insert_004_RawStreamInsert.cs | Complete working example demonstrating file stream and memory stream insertion patterns |
| examples/resources/people.csv | Sample CSV data file for the example |
| examples/README.md | Documentation update listing the new example |
| examples/Program.cs | Integration of new example into the example runner |
| examples/ClickHouse.Driver.Examples.csproj | Build configuration to copy CSV resource file |
| RELEASENOTES.md | Release notes entry for the new feature |
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.
No description provided.