Certain query forms embed an enumerable (non-scalar) subquery; for example: PrimitiveCollectionsQuerySqlServerTest.Column_collection_Where_equality_inline_collection: ss.Set<PrimitiveCollectionsEntity>().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.
Another usage example is the assignment of a primitive collection to a column in ExecuteUpdate (#32494).
Certain query forms embed an enumerable (non-scalar) subquery; for example: PrimitiveCollectionsQuerySqlServerTest.Column_collection_Where_equality_inline_collection:
ss.Set<PrimitiveCollectionsEntity>().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.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.