Improve preprocessor extensibility

オープン
#39,418 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
databases

調査の方向性

Start with QueryTranslationPreprocessor.Process and compare the relational and Cosmos preprocessors named in the issue to trace the existing phase order and query-root specialization. Then read the provider API conventions and relevant preprocessing tests; done means phase ordering, override tree shapes, existing overrides, and default behavior are covered by tests, with provider-facing documentation for each supported boundary.

索引モデルが issue の本文から書いたものです。

説明

area-query needs-design

Database providers can already supply an IQueryTranslationPreprocessorFactory, derive from QueryTranslationPreprocessor or RelationalQueryTranslationPreprocessor, and override Process. There are also narrower extension points such as NormalizeQueryableMethod and ProcessQueryRoots. This issue is about improving that existing provider extension model, not introducing query interception.

Most preprocessing steps are nevertheless constructed and invoked directly inside QueryTranslationPreprocessor.Process. A provider can easily add work before or after the entire base implementation, but inserting or replacing a transformation between the remaining steps can require copying the base implementation and depending on internal visitors.

For example, a provider that needs to transform the navigation-expanded tree before the common query optimizations cannot currently override that individual phase. Copying Process makes the provider responsible for preserving the ordering of normalization, null-check removal, navigation expansion, and optimization, and for incorporating future changes to that sequence.

Current implementation:

Describe the solution you'd like

Expose narrowly scoped, overridable preprocessing phases where database providers need to customize the pipeline, while keeping the common sequencing and required transformations in the base implementation.

The precise API needs design. Prefer protected virtual phase methods and reuse of existing factories/dependencies over requiring providers to copy Process or introducing a general-purpose visitor-registration framework. Document the expression shape and invariants at each supported extension point, especially around normalization and navigation expansion.

Acceptance criteria
  • A derived provider preprocessor can insert a transformation at a supported intermediate boundary, such as after navigation expansion and before common optimization, without reproducing the base processing sequence.
  • A provider can specialize a supported phase while reusing the common behavior of that phase where appropriate.
  • Existing overrides of Process, NormalizeQueryableMethod, and ProcessQueryRoots retain their behavior.
  • Core and relational preprocessors compose correctly; existing Cosmos and relational query-root specialization remains intact.
  • Tests verify phase ordering, the tree shape visible to overrides, and unchanged behavior when no provider customization is supplied.
  • Provider-facing API documentation describes the supported boundaries and required invariants. Newly exposed provider APIs follow the repository's provider API conventions.
Scope and related work
  • This is a database-provider extension surface, not an application interceptor or an additive third-party plugin API.
  • This does not request a hook before parameter extraction or funcletization.
  • #28505 implemented LINQ expression interception; that is not a substitute for provider customization of intermediate preprocessing phases.
  • #19748 concerns interception of SQL generation and is separate from this request.
  • Combining visitors to reduce traversals is a separate performance task.
主要言語
C#
スター
14.8k
フォーク
3.5k
平均マージ
3日 7時間
マージ済み PR(30日)
182

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet/efcore のほかの issue

dotnet/efcore の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。