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

Make all SQL expression nodes quotable #33008

Closed
roji opened this issue Feb 5, 2024 · 0 comments · Fixed by #33210
Closed

Make all SQL expression nodes quotable #33008

roji opened this issue Feb 5, 2024 · 0 comments · Fixed by #33210
Assignees
Labels
area-aot area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement

Comments

@roji
Copy link
Member

roji commented Feb 5, 2024

The interceptors generated for precompiled queries (#25009) will need to contain the SQL to get executed. However, we won't be able to always pre-generate the final SQL as a string; a single LINQ query may be the source of multiple SQL variations, mainly based on different null-ness of parameters included in it. If the number of premutations is small (up to a few nullable parameters), we should be able to pregenerate the final SQLs and stick them in the interceptor (that's #29753); but beyond a certain number of parameters that becomes too much. There are also cases where the SQL is totally dynamic, e.g. when we integrate actual parameter content into the SQL itself.

So in the general case, we need the interceptors to contain an expression representing the SQL, which would be the input for runtime processing which produces the final SQL string ("2nd part of the query pipeline"). This means we need to be able to "quote" all nodes in the SQL tree, i.e. generate C# code to be integrated into the interceptors, which would reconstruct that same tree again at runtime.

@roji roji added this to the 9.0.0 milestone Feb 5, 2024
@roji roji self-assigned this Feb 5, 2024
@roji roji mentioned this issue Feb 5, 2024
37 tasks
roji added a commit to roji/efcore that referenced this issue Feb 29, 2024
roji added a commit that referenced this issue Mar 6, 2024
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Mar 7, 2024
@ajcvickers ajcvickers modified the milestones: 9.0.0, 9.0.0-preview3 Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-aot area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants