Add extensibility point for IQueryOptimizer#444
Add extensibility point for IQueryOptimizer#444austindrenski wants to merge 1 commit intonpgsql:devfrom
Conversation
0145d8c to
e17c5ea
Compare
|
@roji this is ready for review. |
e17c5ea to
093a21c
Compare
|
@austindrenski the general approach and goals look good. However, the two services you're replacing ( How about submitting an issue/PR to EF Core itself, for moving these services out of Internal and providing the extensibility point? If you explain the Npgsql needs clearly I don't think they'll object to it. Many services were defined as Internal because they didn't want to commit to a stable interface for them early on, but it seems that things have matured enough for these to be nailed down. Let me know what you think, and please cc me from any issue/PR. |
|
However, before working on an EF Core issue/PR, it seems like we need to decide whether the null element discrepancy (described here) prevents us from translating constructs such as |
06621e5 to
59778fb
Compare
2bea785 to
7d484a7
Compare
Creates Npgsql implementations of `IExpressionFragmentTranslator` and `IQueryOptimizer` to support more complex translations. These classes make it easier to inject new fragment translations and expression rewrites into the EF Core translation process. This is split out from npgsql#431. Working examples can be found there.
7d484a7 to
ba24cb6
Compare
|
@austindrenski is this still actually useful for anything? |
|
@roji Ehh.. It's on the 3.0 milestone for EF Core, but that's a long ways off still. I'll close this, and reopen in the future if the upstream changes are made. |
|
@austindrenski to be clear, I'm actually not 100% against us overriding internal EF Core types - I've done this several times in the past (not sure if there are any currently). The only consequence is having to be reactive to EF Core minor version releases, since breakage may be introduced to these types. But as a general rule we've always released in lock-step with EF Core anyway, so it's not a big deal. The question is whether there's any value in this, in light of the null behavior discrepancy of |
So right now, I don't think it adds any value... As for the null discrepancy, I went ahead and dropped the translation of I think it would still be cool to translate the former if the discrepancy could be handled through the
As mentioned in #541, there are some functions for which translation will involve sub-query manipulation. (The added complexity is why I'm splitting them into another PR.) I've got a feeling that Since there could be a cost to introducing it (e.g. minor version breakages), we might as well wait until there's a well-defined use case for it. |
|
Makes sense, thanks! |
This work supports #431 by providing extensibility points for query rewriting expression visitors.