-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[release/10.0] Make FromSql work on entity types containing complex JSON #37235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Closing for now, until we see more user signal. |
8a8a7e8 to
8c820a1
Compare
|
@roji what is the basic difference in the customer experience between the proposed fix here and the full fix in 11? |
|
@artl93 for FromSql (the main API we want to enable here), there's no customer experience difference - 10.0 and 11.0 would work exactly the same. But #34627 in 11.0 would take care of some additional scenarios (views, table-valued functions), which are much less mainstream/critical. It would also handle the FromSql in a better way - this PR is more of a workaround to enable the mainstream scenario for 10.0 in a way that's servicing-compatible (so #34627 would also be a cleanup). |
artl93
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. Unblocks customer in new scenario in 10.0.
|
Approved via email. |
Closes #37222
Description
One of EF 10.0's main new features is full support for complex JSON. Unfortunately, we had an omission where the necessary modeling information is absent for raw SQL queries. While the full, proper fix is tracked as #34627 for 11, this PR proposes to temporarily work around the lack of modeling information, allowing the use of SQL queries on entities which have JSON complex types.
Customer impact
Entity types which have complex JSON types on them cannot currently be queried out with SQL queries (e.g. FromSql), which is an important and often-used mechanism where EF cannot translate from LINQ (or translates to sub-optimal SQL).
How found
Multiple customers reported on 10.0.0
Regression
No.
Testing
Added.
Risk
Very low, trivial targeted fix for a case that otherwise immediately throws an exception.
Original description
@AndriySvyryd it's currently impossible to use FromSql on an entity type that contains a complex JSON column, because of #34627. While we should probably do #34627 properly for 11 (should we move it out of the backlog?), it seems possible to work around this in query for 10.0 - what do you think about the approach (temporary only)?
Note that view-only mapping still doesn't work since there's no mapping whatsoever (i.e. there must be a table mapping) - but that seems much more edge-casey.