Skip to content

Conversation

@MikeAmputer
Copy link
Contributor

Previously, only Tuple was 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 convert ValueTuple to Tuple before passing parameters.

This change adds ValueTuple support with minimal code changes.

@CLAassistant
Copy link

CLAassistant commented Aug 16, 2025

CLA assistant check
All committers have signed the CLA.

@MikeAmputer MikeAmputer force-pushed the kravtsov/value-tuple-parameters-support branch from 8c17a8f to 92f7125 Compare August 16, 2025 21:45
@mshustov mshustov requested a review from SpencerTorres August 18, 2025 07:11
Copy link
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 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 ValueTuple and map it to ClickHouse Tuple type
  • Test coverage added for both simple and nested ValueTuple parameters

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

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