Repository navigation
Apply feedback from API review - #38438
Conversation
Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR aligns internal/public (“pubternal”) API marking for relational join helpers, and refactors relational JSON-index detection so shape recognition and JSON-element resolution are split more cleanly. It also updates related APIs/call sites, baselines, and tests (including a SQL Server warning rename and a StructuredJsonPath rendering tweak).
Changes:
- Marked the intended
SelectExpression.AddInnerJoin(..., bool toOneJoin = false, bool prunableJoin = false)overload as[EntityFrameworkInternal], aligning the extensibility/visibility contract. - Extracted JSON-index shape detection into
RelationalIndexExtensions.IsJsonIndex()and renamed/refactored JSON-index construction APIs inRelationalAnnotationProvider(with baseline updates). - Renamed the SQL Server vector-search warning event id/methods and updated resources + functional tests; updated
StructuredJsonPathto support customizable/empty wildcards for null array indices.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/EFCore.Tests/Infrastructure/StructuredJsonPathTest.cs | Adds coverage for custom/empty wildcard rendering for null array indices. |
| test/EFCore.SqlServer.FunctionalTests/Query/Translations/VectorTranslationsSqlServerTest.cs | Updates assertions/config for renamed vector-search warning event id. |
| src/EFCore/Metadata/Conventions/ForeignKeyIndexConvention.cs | Adjusts FK/index coverage logic to exclude JSON-path indexes via CollectionIndices. |
| src/EFCore/EFCore.baseline.json | Removes baseline entry for deleted IsNonComplexCollectionIndex. |
| src/EFCore.SqlServer/Query/Internal/SqlServerVectorSearchWithoutApproximateDetector.cs | Logs renamed vector-search warning. |
| src/EFCore.SqlServer/Properties/SqlServerStrings.resx | Updates warning text/comment to reference renamed event id. |
| src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs | Updates generated logging definition to use renamed event id. |
| src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs | Updates StructuredJsonPath.ToString(...) call to new wildcard parameter. |
| src/EFCore.SqlServer/Extensions/Internal/SqlServerLoggerExtensions.cs | Renames logger extension method for the vector-search warning. |
| src/EFCore.SqlServer/EFCore.SqlServer.baseline.json | Updates baseline for renamed SQL Server event id field. |
| src/EFCore.SqlServer/Diagnostics/SqlServerEventId.cs | Renames the event id constant (without changing numeric value). |
| src/EFCore.Relational/Query/SqlExpressions/SelectExpression.cs | Applies [EntityFrameworkInternal] to the intended AddInnerJoin overload(s). |
| src/EFCore.Relational/Metadata/RelationalAnnotationProvider.cs | Refactors JSON-index detection/construction flow; introduces CreateJsonIndex APIs. |
| src/EFCore.Relational/Metadata/Internal/RelationalIndexExtensions.cs | Adds IsJsonIndex() extension for centralized JSON-index shape detection. |
| src/EFCore.Relational/Infrastructure/StructuredJsonPath.cs | Changes null-array-index rendering from bool flag to configurable wildcard char. |
| src/EFCore.Relational/EFCore.Relational.baseline.json | Updates baselines for renamed JSON-index APIs and StructuredJsonPath signatures. |
Files not reviewed (1)
- src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs: Generated file
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 8 comments.
Files not reviewed (1)
- src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs: Generated file
Comments suppressed due to low confidence (1)
src/EFCore.SqlServer/Extensions/Internal/SqlServerLoggerExtensions.cs:651
- This method rename is a breaking change for any callers using the previous
VectorSearchWithoutApproximateWarningextension. Consider keeping the old method name as an[Obsolete]wrapper delegating to the new method.
public static void VectorSearchWithoutApproximateIndexWarning(
this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics,
string propertyName,
string entityTypeName)
{
…actor, remove pubternal from AddInnerJoin Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
API review baseline changes for
|
Part of #37993
This change corrects API targeting and naming around relational join/json-index helpers.
AddInnerJoinoverloads are left as fully public, and JSON-index detection/construction paths are split more cleanly between caller filtering and helper logic.Join overload visibility contract
[EntityFrameworkInternal]from allAddInnerJoinoverloads — bothAddInnerJoin(SelectExpression, SqlExpression)andAddInnerJoin(ShapedQueryExpression, SqlExpression, Expression, bool, bool)are fully public.JSON index shape detection extraction
IsJsonIndex) on relational index extensions.RelationalAnnotationProvider.Provider method refactor
ConvertToJsonIndextoCreateJsonIndex(IIndex modelIndex, ITableIndex tableIndex)inRelationalAnnotationProvider.CreateJsonIndex(IIndex index)overload;IsJsonIndex()is now called directly at the call site in aforeachloop.CreateJsonIndexnow focuses only on building theRelationalJsonIndexfrom a confirmed JSON index shape, using the current mapped table index passed from the caller.StructuredJsonPathwildcard APIwildcardForNullIndexparameter type fromchartochar?with a default ofnull.nullrenders unspecified array indices as[]; any non-null char renders as[x]. The parameterlessoverride ToString()passes'*'explicitly to preserve the existing[*]default output.API baseline alignment
CreateJsonIndex(IIndex modelIndex, ITableIndex tableIndex)replacing the two previous overloads, and the updatedAppendTo/ToStringsignatures withchar?.