-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 ParameterExtractingExpressionVisitor capable of extracting paths to evaluatable fragments in the tree #32999
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
Milestone
Comments
This was referenced Feb 2, 2024
Closed
roji
added a commit
to roji/efcore
that referenced
this issue
Feb 10, 2024
Closes dotnet#32999 Closes dotnet#32698 Closes dotnet#33012
roji
added a commit
to roji/efcore
that referenced
this issue
Feb 10, 2024
Closes dotnet#32999 Closes dotnet#32698 Closes dotnet#33012
roji
added a commit
to roji/efcore
that referenced
this issue
Feb 15, 2024
Closes dotnet#32999 Closes dotnet#32698 Closes dotnet#33012
roji
added a commit
to roji/efcore
that referenced
this issue
Feb 15, 2024
Closes dotnet#32999 Closes dotnet#32698 Closes dotnet#33012
roji
added a commit
to roji/efcore
that referenced
this issue
Feb 15, 2024
Closes dotnet#32999 Closes dotnet#32698 Closes dotnet#33012
roji
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Feb 15, 2024
roji
added a commit
to roji/efcore
that referenced
this issue
Feb 15, 2024
Closes dotnet#32999 Closes dotnet#32698 Closes dotnet#33012
roji
added a commit
to roji/efcore
that referenced
this issue
Feb 15, 2024
Closes dotnet#32999 Closes dotnet#32698 Closes dotnet#33012
roji
added a commit
that referenced
this issue
Feb 22, 2024
Funcletizer features that cannot be supported in precompiled (or compiled!) mode (basically anything that modifies the tree based on a captured variable):
|
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
Our precompiled query feature (for supporting NativeAOT) involves intercepting query LINQ operators. The terminating query operator is replaced with an implementation that actually executes the query, while intermediate operators are basically no-ops, simply propagating the root DbContext forward to the terminating operator.
However, if an operator accepts a lambda, that lambda can capture variables; this is how query parameters are expressed in EF queries:
In these cases, the interceptor for Where() must be capable of extracting the captured variable's value (which will be different each time the query is executed), and passing it as a query parameter. This means that we need to be able to inspect a LINQ expression tree (the lambda argument to Where), identify evaluatable fragments, and generate interceptor code that will extract those fragments when such a tree is given.
We'll modify the ParameterExtractingExpressionVisitor to have an additional mode, which is used at publish-time when generating query interceptors. This should use the same logic as the regular query execution path, but instead of actually extracting parameters (which are irrelevant at this point), the visitor will produce a tree of paths to all evaluatable fragments. The query precompilation can then take this tree and generate interceptor code based on it which will drill into the given tree, evaluate the relevant fragments and store the results as query parameters in our QueryContext.
As this is quite a change for ParameterExtractingExpressionVisitor, we may as well also optimize it (#32698).
The text was updated successfully, but these errors were encountered: