Query precompilation is all-or-nothing per project; allow writing the interceptors of the queries that did precompile
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 14.8k
- Forks
- 3.5k
- Merge medio
- 3 d 7 h
- PR fusionados (30 d)
- 182
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dotnet/efcore
-
customer-reported
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
GroupBy element `OrderBy(...).First()`/`MaxBy` over an owned type mapped to its own table fails to translatePosiblemente ocupada @cincuranet la tomó hoy. Abiertoarea-groupby area-query
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
dotnet/efcore#39833 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
SQLite: Polygon.Length translates to GLength, which returns 0Posiblemente ocupada @cincuranet la tomó hoy. Abiertoarea-query area-sqlite
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
dotnet/efcore#39826 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Migration lock with LockReleaseBehavior.Transaction doesn't prevent concurrent migrations since per-migration transactionsPosiblemente ocupada @AndriySvyryd la tomó hace 1 día. Abiertoarea-migrations
dotnet/efcore#39824 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Querying a TPC base type with a JSON complex property throwsPosiblemente ocupada @cincuranet la tomó hace 1 día. Abiertoarea-query
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
dotnet/efcore#39814 · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de dotnet/efcore
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
SubtitleEdit/subtitleedit#17247 ·
Los mantenedores suelen responder en 1 día
-
Restore test cleanup fails on Windows when restored files are read-onlyPosiblemente ocupada @JamBalaya56562 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
duplicati/duplicati#8046 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Bundles Documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pyrevitlabs/pyRevit#4285 ·
Los mantenedores suelen responder en 1 día