Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements support for EF.Functions.JsonPathExists() in the Npgsql EF Core provider. The new EF Core API (RelationalDbFunctionsExtensions.JsonPathExists) is translated to the PostgreSQL JSON_EXISTS() SQL function (a SQL/JSON standard function introduced in PostgreSQL 16), with special handling for scalar string columns, complex JSON properties, and owned JSON entities.
Changes:
- Added translation of
EF.Functions.JsonPathExists()toJSON_EXISTS()SQL in the visitor, with pattern matching for different JSON argument shapes (scalar, complex, owned entity) - Updated three placeholder tests from
AssertTranslationFailedto actual SQL assertions verifying theJSON_EXISTS(...)output - Simplified three existing test call sites by using the extension method syntax (
EF.Functions.JsonExists(...)) instead of the fully qualified static call
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/EFCore.PG/Query/Internal/NpgsqlSqlTranslatingExpressionVisitor.cs |
Core implementation: new switch case translates EF.Functions.JsonPathExists() to the SQL JSON_EXISTS() function |
test/EFCore.PG.FunctionalTests/Query/Translations/JsonTranslationsNpgsqlTest.cs |
Replaces AssertTranslationFailed stubs with actual SQL assertions for the three JsonPathExists test variants |
test/EFCore.PG.FunctionalTests/Query/JsonStringQueryTest.cs |
Style cleanup: uses extension method syntax for JsonExists call |
test/EFCore.PG.FunctionalTests/Query/JsonPocoQueryTest.cs |
Style cleanup: uses extension method syntax for JsonExists call |
test/EFCore.PG.FunctionalTests/Query/JsonDomQueryTest.cs |
Style cleanup: uses extension method syntax for JsonExists call |
You can also share your feedback on Copilot code review. Take the survey.
src/EFCore.PG/Query/Internal/NpgsqlSqlTranslatingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
test/EFCore.PG.FunctionalTests/Query/Translations/JsonTranslationsNpgsqlTest.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
You can also share your feedback on Copilot code review. Take the survey.
Closes #3733