Merged
Conversation
This was referenced Jan 10, 2026
There was a problem hiding this comment.
Pull request overview
This PR implements EF.Functions.JsonExists for relational database providers, enabling users to check whether a JSON path exists within JSON data. The implementation supports both scalar string columns containing JSON and complex properties mapped to JSON columns.
Changes:
- Added public API
JsonExistsextension method toRelationalDbFunctionsExtensions - Implemented SQLite translation using
json_type()function with IS NOT NULL check - Implemented SQL Server translation using
JSON_PATH_EXISTS()function with equality comparison to 1 - Added comprehensive test infrastructure with base tests and provider-specific test implementations
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/EFCore.Relational/Extensions/RelationalDbFunctionsExtensions.cs | Adds the public API for JsonExists method that throws on client evaluation |
| src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitor.cs | Implements SQLite translation using json_type() with IS NOT NULL pattern |
| src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitor.cs | Implements SQL Server translation using JSON_PATH_EXISTS() function |
| test/EFCore.Relational.Specification.Tests/Query/Translations/JsonTranslationsRelationalTestBase.cs | Defines base test suite for JSON translation functions with test data and fixture infrastructure |
| test/EFCore.Sqlite.FunctionalTests/Query/Translations/JsonTranslationsSqliteTest.cs | SQLite-specific test implementation with SQL assertion verification |
| test/EFCore.SqlServer.FunctionalTests/Query/Translations/JsonTranslationsSqlServerTest.cs | SQL Server-specific test implementation with version compatibility handling |
| test/EFCore.SqlServer.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonSqlServerFixture.cs | Minor formatting improvement (adds blank line for consistency) |
test/EFCore.SqlServer.FunctionalTests/Query/Translations/JsonTranslationsSqlServerTest.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
...Core.Relational.Specification.Tests/Query/Translations/JsonTranslationsRelationalTestBase.cs
Outdated
Show resolved
Hide resolved
...Core.Relational.Specification.Tests/Query/Translations/JsonTranslationsRelationalTestBase.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Sqlite.FunctionalTests/Query/Translations/JsonTranslationsSqliteTest.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
249ae47 to
6b86657
Compare
AndriySvyryd
approved these changes
Feb 4, 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.
Based on previous work in #37470 by @kimjaejung96
Closes #31136