Query precompilation is all-or-nothing per project; allow writing the interceptors of the queries that did precompile
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start with DbContextOperations.PrecompileQueries and PrecompiledQueryCodeGenerator.ProcessSyntaxTree, the two entry points named in the issue. Trace how generation errors are collected and how per-query state is written, then inspect the precompilation tests and the documented non-NativeAOT behavior. Done means an opt-in can write interceptors for successful queries, report failures, and avoid leaving partial query regions when generation fails.
索引モデルが issue の本文から書いたものです。
説明
DbContextOperations.PrecompileQueries throws if precompilationErrors.Count > 0, so one query that cannot be precompiled discards the interceptors of every other query in the project. The docs ("Precompiled queries without NativeAOT") say the command "will generate a compiled model and interceptors for queries which could be precompiled", which is not what 10.0.11 does.
In a real application (SentenceStudio: ~600 queries, 4 projects) this means no project gets any interceptors until the last query is rewritten. With EF Core 10.0.11 plus the precompiler fixes now on main, 394 queries precompile and 202 do not; the stock tool writes 0 of the 394.
A second, smaller problem blocks a simple "continue on error": PrecompiledQueryCodeGenerator.ProcessSyntaxTree appends to the file's _code, _namespaces and _unsafeAccessors while it generates a query. If generation throws after #region QueryN was written, the catch records the error and continues, leaving that half-written region in the file.
What we did locally (design-time only) to measure the rest of the app:
- In
ProcessSyntaxTree, snapshot_code,_namespacesand_unsafeAccessorsbefore each query and restore them in thecatch. - In
DbContextOperations.PrecompileQueries, an opt-in that reports the errors as warnings and writes the files.
Ask: an option (for example --allow-partial / <EFPrecompileQueriesAllowPartial>) that writes the precompilable queries and reports the rest, at least when not publishing NativeAOT. Under NativeAOT the remaining queries still throw "Query wasn't precompiled", so the option is most useful for (a) the non-AOT startup benefit the docs describe and (b) incremental migration of a large codebase to NativeAOT.
Versions: EF Core 10.0.11, .NET SDK 11.0.100-rc.2.
- 主要言語
- C#
- スター
- 14.8k
- フォーク
- 3.5k
- 平均マージ
- 3日 7時間
- マージ済み PR(30日)
- 182
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/efcore のほかの issue
-
customer-reported
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
GroupBy element `OrderBy(...).First()`/`MaxBy` over an owned type mapped to its own table fails to translate対応中かも @cincuranet が今日担当しました。 オープンarea-groupby area-query
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
dotnet/efcore#39833 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
SQLite: Polygon.Length translates to GLength, which returns 0対応中かも @cincuranet が今日担当しました。 オープンarea-query area-sqlite
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
dotnet/efcore#39826 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Migration lock with LockReleaseBehavior.Transaction doesn't prevent concurrent migrations since per-migration transactions対応中かも @AndriySvyryd が 1 日前に担当しました。 オープンarea-migrations
dotnet/efcore#39824 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Querying a TPC base type with a JSON complex property throws対応中かも @cincuranet が 1 日前に担当しました。 オープンarea-query
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
dotnet/efcore#39814 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
SubtitleEdit/subtitleedit#17247 ·
メンテナーはふだん 1 日以内に返信
-
Restore test cleanup fails on Windows when restored files are read-only対応中かも @JamBalaya56562 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
duplicati/duplicati#8046 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
Bundles Documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pyrevitlabs/pyRevit#4285 ·
メンテナーはふだん 1 日以内に返信