Add support for ValueTuple query parameters#14
Open
MikeAmputer wants to merge 4 commits intoClickHouse:mainfrom
Open
Add support for ValueTuple query parameters#14MikeAmputer wants to merge 4 commits intoClickHouse:mainfrom
MikeAmputer wants to merge 4 commits intoClickHouse:mainfrom
Conversation
8c17a8f to
92f7125
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for ValueTuple as query parameters in ClickHouse.Driver. Previously only reference-type Tuple was supported, but modern C# code typically uses value-type ValueTuple (e.g., ("a", 1)). This change enables developers to pass ValueTuple parameters directly without manual conversion.
Key Changes:
- Type converter extended to recognize
ValueTupleand map it to ClickHouseTupletype - Test coverage added for both simple and nested
ValueTupleparameters
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ClickHouse.Driver/Types/TypeConverter.cs | Adds ValueTuple type detection and conversion to ClickHouse Tuple type |
| ClickHouse.Driver.Tests/Types/TypeMappingTests.cs | Adds test case verifying ValueTuple maps to ClickHouse Tuple type |
| ClickHouse.Driver.Tests/SQL/SqlParameterizedSelectTests.cs | Adds integration tests for simple and nested ValueTuple parameters in SQL queries |
Contributor
Author
|
@alex-clickhouse Hi, could you let me know if there are any blockers or anything else needed before this PR can be merged? |
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.
Previously, only
Tuplewas supported.Many modern C# APIs and user code prefer
ValueTuple, which is also the default type for inline tuples in C# like("a", 1). Without this, developers had to manually convertValueTupletoTuplebefore passing parameters.This change adds
ValueTuplesupport with minimal code changes.