dotnet / dotnet/efcore

Cosmos: Advanced type mapping inference (for scalar collections)

Open
#34,026 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-cosmos area-primitive-collections area-query consider-for-next-release
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

In various places in the Cosmos scalar collection implementation, we currently simply infer an array's type mapping from its CLR type; this loses type mapping information that may be configured on the array's element. Since Cosmos uses very little type mapping information, this mainly means that arrays over elements with value converters don't function correctly.

We should port over RelationalTypeMappingPostprocessor, which is a post-processing step for advanced type mapping inference from elements back to the arrays the came from.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Cosmos scalar collection implementation and the existing RelationalTypeMappingPostprocessor. Compare how relational inference propagates element mappings back to arrays, then verify that Cosmos arrays over elements with value converters retain the configured mapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.