Skip to content

Add InsertRawStreamAsync to connection for raw file inserts#130

Merged
alex-clickhouse merged 4 commits intomainfrom
raw-insert
Dec 12, 2025
Merged

Add InsertRawStreamAsync to connection for raw file inserts#130
alex-clickhouse merged 4 commits intomainfrom
raw-insert

Conversation

@alex-clickhouse
Copy link
Copy Markdown
Collaborator

No description provided.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ClickHouse.Driver/ADO/ClickHouseConnection.cs 82.35% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 InsertRawStreamAsync on ClickHouseConnection with 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

Comment thread ClickHouse.Driver/ADO/ClickHouseConnection.cs
Comment thread ClickHouse.Driver/ADO/ClickHouseConnection.cs
Comment thread ClickHouse.Driver/ADO/ClickHouseConnection.cs
Comment thread ClickHouse.Driver/ADO/ClickHouseConnection.cs
Comment thread examples/Insert_004_RawStreamInsert.cs
Comment thread ClickHouse.Driver.Tests/SQL/RawStreamInsertTests.cs
Comment thread ClickHouse.Driver.Tests/SQL/RawStreamInsertTests.cs
@alex-clickhouse alex-clickhouse merged commit b275ff2 into main Dec 12, 2025
15 of 16 checks passed
@alex-clickhouse alex-clickhouse deleted the raw-insert branch December 12, 2025 08:37
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