Skip to content

Make all SQL expression nodes quotable #33008

@roji

Description

@roji

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions