Skip to content

Allow reading row values (records) #2356

Closed

Description

@roji

#2350 added row value support to the EF Core PG provider, using ValueTuple/Tuple to express a row value. This allows e.g. comparisons: (a, b) > (3, 4). However, we currently don't support projecting a row value out of the database (see this test for example).

If we change the ADO layer to return ITuple for row values (records) (npgsql/npgsql#4442), then we can also add a full type mapping for row values at the EF Core level, allowing records to be materialized just like any other entity type.

Note, however, that sending a row values as a parameter isn't supported by PostgreSQL; this means that actual entity ITuple properties aren't likely to be useful (unless read-only). However, this would allow projecting them out via non-entity Select.

Supporting literal value generation may make sense, though we currently handle that by preventing evaluation of ITuples in the query. There's some tension here between row values as special SQL expressions (represented by PostgresRowValueExpression), and row values as an actual, supported type (like int or string, with a type mapping).

Activity

  1. added this to the 7.0.0 milestone on May 8, 2022
  2. self-assigned this
    on May 8, 2022
  3. added a commit that references this issue on Oct 15, 2022
    8e85b3e
  4. added a commit that references this issue on Oct 15, 2022
    73727ab
  5. added a commit that references this issue on Oct 15, 2022
    dd8eec0
  6. added theissue type on Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions