-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/translate json functions #29306 #30010
base: main
Are you sure you want to change the base?
Feature/translate json functions #29306 #30010
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR - it's a good start, see comments below.
Note that there are some other JSON functions supported by SQL Server (ISJSON, JSON_ARRAY, JSON_OBJECT...). Ideally we'd have translations for all of them (and the relevant SQLite ones as well); of course you don't have to do that in this PR, but if you feel like working on those that would be great.
src/EFCore.SqlServer/Extensions/SqlServerDbFunctionsExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Extensions/SqlServerDbFunctionsExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Extensions/SqlServerDbFunctionsExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Extensions/SqlServerDbFunctionsExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Extensions/SqlServerDbFunctionsExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Sqlite.Core/Extensions/SqliteDbFunctionsExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Sqlite.Core/Extensions/SqliteDbFunctionsExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Sqlite.Core/Query/Internal/SqliteJsonFunctionsTranslator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Sqlite.Core/Query/Internal/SqliteJsonFunctionsTranslator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Sqlite.Core/Query/Internal/SqliteJsonFunctionsTranslator.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some changes now. And think I got them all covered. But little bit uncertain about the propagation of null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joelmandell sorry, it's taking long for me to get around to this, here are some comments. Please rebase this PR on the latest main and check out any test failures after that.
src/EFCore.SqlServer/Query/Internal/SqlServerJsonFunctionsTranslator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/SqlServerJsonFunctionsTranslator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/SqlServerJsonFunctionsTranslator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/SqlServerJsonFunctionsTranslator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Extensions/SqlServerDbFunctionsExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/SqlServerJsonFunctionsTranslator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Sqlite.Core/Extensions/SqliteDbFunctionsExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Sqlite.Core/Query/Internal/SqliteJsonFunctionsTranslator.cs
Outdated
Show resolved
Hide resolved
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore.TestModels.JsonQuery; | ||
public class JsonEntityBasicString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to add this rather than simply using JsonEntityBasic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JsonEntityBasic has mappings of the columns to classes, and this works only for strings If I understand it correctly.
test/EFCore.Sqlite.FunctionalTests/Query/JsonFunctionSqliteTest.cs
Outdated
Show resolved
Hide resolved
json_value in differents rdbms: mysql: https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=591207ceddca6fe4f11a3ad8589e7c5b |
…ty type as keyless. (dotnet#32032) Fixes dotnet#24722
[main] Update dependencies from dotnet/arcade - React to xunit breaking changes
…to parent table. (dotnet#32031) Similar to JSON entities, owned entities that are mapped to the same table as their owner should be treated as scalars for the purpose of temporal query validation - they are always in sync with the parent entity, so all operations should be allowed for them, not only AsOf. Fixes dotnet#29156
…1012.7 (dotnet#32044) [main] Update dependencies from dotnet/runtime
…1013.17 (dotnet#32049) [release/8.0] Update dependencies from dotnet/runtime
…1014.1 (dotnet#32050) [main] Update dependencies from dotnet/runtime
…1014.5 (dotnet#32054) [main] Update dependencies from dotnet/runtime
…010.4 (dotnet#32057) [main] Update dependencies from dotnet/arcade
…005.1 (dotnet#32061) [release/8.0] Update dependencies from dotnet/arcade
…1015.3 (dotnet#32060) [main] Update dependencies from dotnet/runtime
…n the base. (dotnet#32041) Fixes dotnet#26218 Fixes dotnet#27404
…1016.9 (dotnet#32067) [release/8.0] Update dependencies from dotnet/runtime
…1016.15 (dotnet#32068) [release/8.0] Update dependencies from dotnet/runtime
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… 7.0.12 (dotnet#32063) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1017.2 (dotnet#32074) [main] Update dependencies from dotnet/runtime
…1224.2 (dotnet#32670) [main] Update dependencies from dotnet/runtime
Instead of on a private list on SelectExpression. Part of dotnet#31049
…r only because hardcoded column types etc can be moved from provider to relational/core (dotnet#32706) Also removed some tests from InMemory QBT - those tests were duplicated from SqlServer QBT but have been moved to AdHoc test suites and run for all providers.
Ping @roji. I do not know if it is to early to continue on this one now? :) |
…slator.cs Co-authored-by: Shay Rojansky <roji@roji.org>
…slator.cs Co-authored-by: Shay Rojansky <roji@roji.org>
Co-authored-by: Shay Rojansky <roji@roji.org>
Co-authored-by: Shay Rojansky <roji@roji.org>
Co-authored-by: Shay Rojansky <roji@roji.org>
Co-authored-by: Shay Rojansky <roji@roji.org>
Co-authored-by: Shay Rojansky <roji@roji.org>
Co-authored-by: Shay Rojansky <roji@roji.org>
…/joelmandell/efcore into feature/translate_json_functions
Fixes #29306