Introduce relational EF.Functions.JsonPathExists#37732
Merged
roji merged 1 commit intodotnet:mainfrom Feb 20, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR renames the relational JSON path existence function from EF.Functions.JsonExists to EF.Functions.JsonPathExists to avoid name conflicts (notably with EFCore.PG) and to clarify that the argument is a JSONPath rather than a simple key.
Changes:
- Renamed the public API
RelationalDbFunctionsExtensions.JsonExiststoJsonPathExists. - Updated SQL Server and SQLite translation visitors to recognize/translate the new method name.
- Renamed/updated relational and provider functional tests to use
JsonPathExistsand updated expected SQL baselines.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/EFCore.Sqlite.FunctionalTests/Query/Translations/JsonTranslationsSqliteTest.cs | Renames overridden test methods and base calls to JsonPathExists_* and keeps SQLite SQL assertions aligned. |
| test/EFCore.SqlServer.FunctionalTests/Query/Translations/JsonTranslationsSqlServerTest.cs | Renames overridden test methods and base calls to JsonPathExists_* and keeps SQL Server SQL assertions aligned. |
| test/EFCore.Relational.Specification.Tests/Query/Translations/JsonTranslationsRelationalTestBase.cs | Renames the relational JSON translation tests and updates LINQ to call EF.Functions.JsonPathExists. |
| src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitor.cs | Updates method-name dispatch to translate JsonPathExists. |
| src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitor.cs | Updates method-name dispatch to translate JsonPathExists. |
| src/EFCore.Relational/Extensions/RelationalDbFunctionsExtensions.cs | Public API rename from JsonExists to JsonPathExists. |
AndriySvyryd
approved these changes
Feb 20, 2026
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.
As part of syncing EFCore.PG, I noticed that the new EF.Functions.JsonExists introduced in #31136 (preview.2) conflicts with an existing function in EFCore.PG, which takes a key name (not a jsonpath). In addition, both the PG and SQL Server functions are actually called jsonb_path_exists()/JSON_PATH_EXISTS(), and including "path" in the name makes it more explicit that the argument represents a jsonpath rather than a simple property/key. The other databases also diverge quite widely around this, so while the capability exists everywhere, it's named differently.
So this PR renames EF.Function.JsonExists to JsonPathExists.
Part of #31136