Conversation
There was a problem hiding this comment.
Pull request overview
This PR syncs EFCore.PG to EF Core 11.0.0-preview.5.26251.112, updating provider code and SQL baselines to stay aligned with upstream query/type-mapping changes in the PostgreSQL provider.
Changes:
- Bumps the .NET SDK and EF/Microsoft.Extensions package versions needed for the new EF preview.
- Adapts provider internals to upstream EF changes, including JSON path API renaming,
= ANY(scalar_subquery)SQL generation, and binary-expression type-mapping handling. - Rewrites affected SQL baselines across functional tests to match EF’s cast simplification behavior and new byte-array translation coverage.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
test/EFCore.PG.FunctionalTests/Query/Translations/Temporal/DateOnlyTranslationsNpgsqlTest.cs |
Updates DateOnly SQL baselines after cast simplification. |
test/EFCore.PG.FunctionalTests/Query/Translations/NodaTime/InstantTranslationsTest.cs |
Removes redundant timestamptz cast from expected SQL. |
test/EFCore.PG.FunctionalTests/Query/Translations/MiscellaneousTranslationsNpgsqlTest.cs |
Refreshes Convert.ToInt32 SQL baselines and formatting. |
test/EFCore.PG.FunctionalTests/Query/Translations/MathTranslationsNpgsqlTest.cs |
Updates Sign SQL baselines after cast removal. |
test/EFCore.PG.FunctionalTests/Query/Translations/CitextTranslationsTest.cs |
Removes redundant citext casts from expected SQL. |
test/EFCore.PG.FunctionalTests/Query/Translations/ByteArrayTranslationsNpgsqlTest.cs |
Updates byte-array SQL baseline and overrides new upstream Any() test. |
test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs |
Adjusts primitive collection SQL baseline for parameter typing. |
test/EFCore.PG.FunctionalTests/Query/NorthwindSqlQueryNpgsqlTest.cs |
Removes redundant casts in composed raw-SQL baseline. |
test/EFCore.PG.FunctionalTests/Query/Inheritance/TPTGearsOfWarQueryNpgsqlTest.cs |
Refreshes timestamp truncation baseline. |
test/EFCore.PG.FunctionalTests/Query/Inheritance/TPCGearsOfWarQueryNpgsqlTest.cs |
Refreshes timestamp truncation baseline. |
test/EFCore.PG.FunctionalTests/Query/GearsOfWarQueryNpgsqlTest.cs |
Refreshes timestamp truncation baseline. |
src/EFCore.PG/Update/Internal/NpgsqlUpdateSqlGenerator.cs |
Adapts to EF JSON path API rename from Ordinals to Indices. |
src/EFCore.PG/Query/NpgsqlSqlExpressionFactory.cs |
Preserves explicit result type mappings for heterogeneous binary expressions. |
src/EFCore.PG/Query/Internal/NpgsqlQuerySqlGenerator.cs |
Emits explicit array casts for ANY over scalar subqueries during SQL generation. |
src/EFCore.PG/Query/Internal/NpgsqlQueryableMethodTranslatingExpressionVisitor.cs |
Stops modeling scalar-subquery ANY disambiguation as a removable convert node. |
src/EFCore.PG.NodaTime/Query/Internal/NpgsqlNodaTimeMemberTranslatorPlugin.cs |
Fixes DateInterval.End translation to carry the correct intermediate result mapping. |
global.json |
Bumps the SDK to the matching preview. |
Directory.Packages.props |
Updates central package versions and adds explicit Microsoft.Extensions pins. |
Directory.Build.props |
Enables central transitive package pinning. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Syncs to the latest EF Core daily build for preview.5.
EF-side PRs that required changes
StructuredJsonPath.Ordinals→IndicesNpgsqlUpdateSqlGeneratorAny()over byte arrayoverrideonByteArrayTranslationsNpgsqlTest.Any()Type mapping bug fixes exposed by EF's new cast removal
1.
DateInterval.End: wrong result type fordate - intervalPostgreSQL returns
timestamp without time zonefordate - interval, butNpgsqlSqlExpressionFactory.ApplyTypeMappingsalways used the left operand's type mapping (date) for the result, ignoring the explicitly passed type mapping. Fixed by usingtypeMapping ?? newLeft.TypeMapping.2.
= ANY(scalar_subquery): syntactic cast incorrectly modeled as type castWe used
SqlUnaryExpression(Convert)to force PostgreSQL's array-formANY()(vs. subquery-form), but both the subquery and cast had the sameinteger[]store type. This isn't a type mapping bug — it's a syntactic disambiguation. Moved the cast emission toNpgsqlQuerySqlGenerator.VisitArrayAny(), which detectsScalarSubqueryExpressionand appends::storeTypedirectly in SQL generation.