Skip to content

Extended type support#4

Merged
alex-clickhouse merged 5 commits intomainfrom
extended-type-support
Mar 13, 2026
Merged

Extended type support#4
alex-clickhouse merged 5 commits intomainfrom
extended-type-support

Conversation

@alex-clickhouse
Copy link
Collaborator

No description provided.

Copy link

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

Adds extended ClickHouse type support to the EFCore.ClickHouse provider by introducing new relational type mappings and expanding the type-mapping source, with accompanying integration/unit tests and README updates.

Changes:

  • Added type mappings for arrays (T[] / List<T>), maps (Dictionary<K,V>), tuples (Tuple<> / ValueTuple<>), TimeSpan (Time/Time64), IPAddress (IPv4/IPv6), big integers (Int128/256, UInt128/256 via BigInteger), and C# enums (string-based).
  • Enhanced store-type parsing (unwrap Nullable(...) / LowCardinality(...), handle container/variant store types) and mapping resolution in ClickHouseTypeMappingSource.
  • Added extensive integration tests (Testcontainers) + unit tests for type mapping source behavior; updated README “Supported Types”.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
test/EFCore.ClickHouse.Tests/ExtendedTypeMappingTests.cs Adds integration + unit tests for newly supported types and wrapper parsing.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ListToArrayConverter.cs Introduces List↔Array value converter for List<T> array mappings.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseTupleTypeMapping.cs Adds tuple mapping and driver tuple→ValueTuple conversion + literal generation.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseTimeSpanTypeMapping.cs Adds Time/Time64 mapping and SQL literal generation for TimeSpan.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseMapTypeMapping.cs Adds Map(K,V) mapping, comparer, and SQL literal generation.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseIPAddressTypeMapping.cs Adds IPv4/IPv6 mapping for IPAddress.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseEnumTypeMapping.cs Adds enum-to-string mapping using EnumToStringConverter<>.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseBigIntegerTypeMapping.cs Adds BigInteger mapping for Int128/256 + UInt128/256 with conversion logic.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseBigDecimalTypeMapping.cs Adds ClickHouseDecimal mapping for high-precision decimals + conversion.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseArrayTypeMapping.cs Adds array/list mapping support (converter-aware) + comparer + literal generation.
src/EFCore.ClickHouse/Storage/Internal/ClickHouseTypeMappingSource.cs Extends store type parsing and mapping resolution for new types/wrappers.
README.md Updates supported types matrix and current feature status.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link

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

Adds extended ClickHouse type support to the provider by expanding the type mapping source and introducing new relational type mappings for additional scalar and container types, along with both unit-level literal tests and integration tests against a real ClickHouse container.

Changes:

  • Added new relational type mappings for TimeSpan (Time/Time64), BigInteger (Int128/Int256/UInt128/UInt256), IPAddress (IPv4/IPv6), ClickHouseDecimal (high-precision decimals), plus container types Array, Map, and Tuple.
  • Extended ClickHouseTypeMappingSource parsing to recognize Decimal variants, Time64, enums, wrappers (Nullable, LowCardinality), and container store types.
  • Added extensive tests: SQL literal generation tests and container-based roundtrip/query tests; updated README supported-types matrix.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/EFCore.ClickHouse.Tests/TypeMappingLiteralTests.cs Adds literal-generation coverage for new mappings (BigInteger/IP/BigDecimal/Array/Map/Tuple).
test/EFCore.ClickHouse.Tests/ExtendedTypeMappingTests.cs Adds integration tests and mapping-source unit tests for extended types using Testcontainers.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ListToArrayConverter.cs Introduces List<T>T[] value converter for array mappings.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseTupleTypeMapping.cs New tuple mapping supporting both Tuple<> and ValueTuple<> with reader conversion + SQL literal generation.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseTimeSpanTypeMapping.cs New Time/Time64 (TimeSpan) mapping and literal formatting.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseMapTypeMapping.cs New Map(K,V) mapping with dictionary comparer and SQL literal generation.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseIPAddressTypeMapping.cs New IPAddress mapping for IPv4/IPv6 store types.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseEnumTypeMapping.cs Adds enum CLR mapping via EnumToStringConverter<>.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseDecimalTypeMapping.cs Adjusts decimal store-type formatting (Decimal(p,s) spacing).
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseBigIntegerTypeMapping.cs New BigInteger mapping for 128/256-bit integer store types.
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseBigDecimalTypeMapping.cs New ClickHouseDecimal mapping for high-precision decimals (Decimal128/256 scenarios).
src/EFCore.ClickHouse/Storage/Internal/Mapping/ClickHouseArrayTypeMapping.cs New Array(T) mapping including list support (converter + comparer) and literal generation.
src/EFCore.ClickHouse/Storage/Internal/ClickHouseTypeMappingSource.cs Extends mapping resolution/parsing for wrappers, enums, decimals, time, arrays, maps, tuples, and new scalars.
README.md Updates documented supported types and current status.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@alex-clickhouse alex-clickhouse merged commit b073d44 into main Mar 13, 2026
2 checks passed
@alex-clickhouse alex-clickhouse deleted the extended-type-support branch March 13, 2026 10:25
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