Skip to content
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

Allow non-composable raw SQL queries for TPH non-root types #24157

Open
Tracked by #21888
roji opened this issue Feb 15, 2021 · 3 comments
Open
Tracked by #21888

Allow non-composable raw SQL queries for TPH non-root types #24157

roji opened this issue Feb 15, 2021 · 3 comments

Comments

@roji
Copy link
Member

roji commented Feb 15, 2021

In #18232, we allowed non-composable raw SQL queries for TPH root types, by eliminating the discriminator predicate when it is configured as complete. However, it is still impossible to use non-compsable raw SQL for querying non-root types.

I'm guessing that was discussed before, but... we could say that with raw SQL queries, it's the user's responsibility to write the SQL such that only the correct entity type comes back, and therefore not add the discriminator predicate in EF. If the user's SQL is wrong, unexpected entity types will come back and materialization would fail.

Originally requested by @kobruleht in npgsql/efcore.pg#1700

@ajcvickers
Copy link
Member

@smitpatel to find general issue.

@kobruleht
Copy link

kobruleht commented Feb 16, 2021

Maybe FromSqlRaw queries should not modified by EF Core.

This would allow to use multiple Sql commands ending with semicolon in query.

Posted also in https://www.postgresql.org/message-id/c18b027c-4629-58a5-a499-64dc8a233e8f%40hot.ee

@smitpatel
Copy link
Member

Related #21888

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants