You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support mapping ValueTuple with row constructors #563
That's a very cool idea, and it also connects with another idea I had: to map PostgreSQL composites to value tuples. For some reason I got a bit excited for 4.0 and implemented support for mapping composites as dynamic - but doing value tuple seems much more useful/interesting. It may be better to first look at what this means at the Npgsql ADO.NET level, before thinking about it in EF Core.
If we do end up mapping composites to value tuple, then ROW(...) very neatly fits as the literal SQL representation, which is definitely cool. PostgreSQL also allows you to treat a row of a regular table as a composite type - SELECT * FROM data WHERE data.* = ROW(1,2) - but I can't really see EF Core generating any SQL even close to that. However, composite literals would still be useful for filtering on a composite column of a table, i.e. WHERE my_table.my_column = ROW(1,2).
So I'd option an issue on https://github.com/npgsql/npgsql/ to track composite mapping to value tuples and concentrate on that first. Once that's done, we can (finally) look at composite support in the EF Core provider (#22), and do the ROW(...) literal representation as part of that. Sounds good?
Activity
[-]Mapping ValueTuple with row constructors [/-][+]Support mapping ValueTuple with row constructors [/+]roji commentedon Aug 4, 2018
That's a very cool idea, and it also connects with another idea I had: to map PostgreSQL composites to value tuples. For some reason I got a bit excited for 4.0 and implemented support for mapping composites as dynamic - but doing value tuple seems much more useful/interesting. It may be better to first look at what this means at the Npgsql ADO.NET level, before thinking about it in EF Core.
If we do end up mapping composites to value tuple, then
ROW(...)very neatly fits as the literal SQL representation, which is definitely cool. PostgreSQL also allows you to treat a row of a regular table as a composite type -SELECT * FROM data WHERE data.* = ROW(1,2)- but I can't really see EF Core generating any SQL even close to that. However, composite literals would still be useful for filtering on a composite column of a table, i.e.WHERE my_table.my_column = ROW(1,2).So I'd option an issue on https://github.com/npgsql/npgsql/ to track composite mapping to value tuples and concentrate on that first. Once that's done, we can (finally) look at composite support in the EF Core provider (#22), and do the
ROW(...)literal representation as part of that. Sounds good?