dotnet / dotnet/efcore

Relational: support queries converting a relational rowset to a primitive collection

Open
#33,792 1 comment 0 reactions 0 assignees View on GitHub
area-primitive-collections area-query customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

Certain query forms embed an enumerable (non-scalar) subquery; for example: PrimitiveCollectionsQuerySqlServerTest.Column_collection_Where_equality_inline_collection: `ss.Set().Where(c => c.Ints.Where(i => i != 11) == new[] { 1, 111 }`.

To translate this, we must be able to convert the subquery (`SELECT i FROM c.Ints WHERE i <> 11`) and convert it to a primitive collection. For most databases, this means converting the relational rowset to a JSON array string; in PostgreSQL, a rowset can be converted to an array via [array_agg](https://www.postgresql.org/docs/current/functions-aggregate.html).

Another usage example is the assignment of a primitive collection to a column in ExecuteUpdate (#32494).

Note: this is implemented in Cosmos via [the ARRAY() operator](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/object-array#arrays).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.