Skip to content
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

Open
wants to merge 993 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
993 commits
Select commit Hold shift + click to select a range
e3a58ca
Merge in 'release/7.0' changes
dotnet-bot Oct 12, 2023
8e4513e
Throw for conflicting explicit relationships when configuring an enti…
AndriySvyryd Oct 12, 2023
d4e344b
[main] Update dependencies from dotnet/arcade (#32000)
dotnet-maestro[bot] Oct 12, 2023
d0055a4
Fix to #29156 - TemporalAll for temporal owned entities mapped to par…
maumar Oct 12, 2023
058b875
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 13, 2023
5ff7e9f
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 14, 2023
92923bd
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 14, 2023
9fe9271
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 15, 2023
7310b30
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Oct 16, 2023
fad6e0f
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Oct 16, 2023
2b26705
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 16, 2023
2b0283b
Remove the owned navigation on the derived type when configuring it o…
AndriySvyryd Oct 16, 2023
afc2414
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 17, 2023
2b73ae7
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 17, 2023
87a58cc
[release/8.0] Don't throw for non-generic collection types (#32059)
ajcvickers Oct 17, 2023
a9e3a82
Merge branch 'release/8.0'
ajcvickers Oct 17, 2023
74aa115
Bump Azure.Identity from 1.10.1 to 1.10.2 (#32064)
dependabot[bot] Oct 17, 2023
80c7aa0
Bump Microsoft.AspNetCore.Identity.EntityFrameworkCore from 7.0.11 to…
dependabot[bot] Oct 17, 2023
aa44131
Merge branch 'release/8.0'
ajcvickers Oct 17, 2023
3591505
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 17, 2023
39da9a7
Revert Azure SQL streaming breaking change (#32069)
AndriySvyryd Oct 17, 2023
7a0eede
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 18, 2023
1b2ff36
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 18, 2023
86760eb
Merge branch 'release/8.0'
ajcvickers Oct 18, 2023
f36540d
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Oct 18, 2023
9ec4c33
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 18, 2023
50ee18e
Fix to #31961 - Projection filtering on second-level reference could …
maumar Oct 19, 2023
e193c30
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 19, 2023
7e4815d
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 19, 2023
61afad4
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 19, 2023
320e2c4
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 20, 2023
d1a41e5
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 20, 2023
495abf0
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 21, 2023
3ac96dc
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 21, 2023
bd355ef
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 21, 2023
008a616
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 22, 2023
17a9035
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Oct 23, 2023
0ff25bd
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 23, 2023
bf239e6
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Oct 23, 2023
fe3d6c4
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 23, 2023
d990683
Update branding to 6.0.25 (#32086)
vseanreesermsft Oct 23, 2023
5d36a9b
Update branding to 7.0.14 (#32087)
vseanreesermsft Oct 23, 2023
ebac228
Merge in 'release/6.0' changes
dotnet-bot Oct 23, 2023
31662b3
Merge in 'release/7.0' changes
dotnet-bot Oct 23, 2023
aa5830f
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 24, 2023
7112c2b
Fix to #32023 - Case expressions may only be nested to level 10 when …
maumar Oct 24, 2023
4332623
Fix to #32062 - Altering a nullable column to not null generates inva…
maumar Oct 24, 2023
16eea3d
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 24, 2023
db8e933
Merge branch 'release/6.0' into release/7.0
ajcvickers Oct 24, 2023
4313d6d
Merge branch 'release/7.0' into release/8.0
ajcvickers Oct 24, 2023
346cc35
Merge branch 'release/8.0'
ajcvickers Oct 24, 2023
1df1743
Disabling failing test.
ajcvickers Oct 24, 2023
b66c286
Bump Azure.Identity from 1.10.2 to 1.10.3 (#32139)
dependabot[bot] Oct 24, 2023
b614e3e
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 24, 2023
e8d9247
Stabilize versions (#32110)
wtgodbe Oct 24, 2023
00d51eb
Change IStateManager.StartTrackingFromQuery to use ISnapshot instead …
AndriySvyryd Oct 24, 2023
d8e9f61
Use OrderedDictionary or Dictionary instead of SortedDictionary in Ru…
AndriySvyryd Oct 24, 2023
6a75f1d
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 25, 2023
eb449a2
Make SQL CLR optional for running EF tests (#32143)
ajcvickers Oct 25, 2023
1425f65
[internal/release/8.0] Update dependencies from dnceng/internal/dotne…
dotnet-bot Oct 25, 2023
e0d5966
Add a logo (#32156)
bricelam Oct 26, 2023
f8d153e
SqlServer: Fix FreeText parameter type mapping (#32163)
bricelam Oct 26, 2023
d4fd971
Fix failing tests (#32164)
bricelam Oct 26, 2023
94bff5a
Revert binary breaking change on IEntityType (#32166)
AndriySvyryd Oct 26, 2023
72b8d33
Merge in 'release/8.0' changes
dotnet-bot Oct 26, 2023
a0d6d06
[main] Update dependencies from dotnet/runtime (#32162)
dotnet-maestro[bot] Oct 27, 2023
d750109
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 28, 2023
cca2b4c
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 29, 2023
053dc5d
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Oct 30, 2023
187b0b8
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Oct 30, 2023
97a9c55
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 30, 2023
b776d0d
Merge in 'release/8.0' changes
dotnet-bot Oct 30, 2023
943e85b
Bump Microsoft.Data.SqlClient from 5.1.1 to 5.1.2 (#32187)
dependabot[bot] Oct 30, 2023
d0cc35d
Bump Microsoft.Azure.Cosmos from 3.35.4 to 3.36.0 (#32188)
dependabot[bot] Oct 30, 2023
44b9763
Bump Microsoft.AspNetCore.Identity.EntityFrameworkCore from 7.0.12 to…
dependabot[bot] Oct 30, 2023
5d2c758
[internal/release/8.0] Update dependencies from dnceng/internal/dotne…
dotnet-bot Oct 31, 2023
0740f1c
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Oct 31, 2023
e017dc1
Merged PR 34963: [internal/release/8.0] Update dependencies from dnce…
dotnet-bot Oct 31, 2023
ab4b617
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 1, 2023
4a33b7f
Update DailyBuilds to indicate build to use for EF8 (#32210)
ajcvickers Nov 2, 2023
23d6a1d
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 2, 2023
f168170
Refactor out the baselines for CSharpRuntimeModelCodeGeneratorTest (#…
AndriySvyryd Nov 2, 2023
60915e7
Allow to ignore attributes when finding type mapping (#32193)
AndriySvyryd Nov 2, 2023
5be4798
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 3, 2023
338b76a
Take into account Contains item visitation in SqlNullabilityProcessor…
roji Nov 3, 2023
08ee676
Visit arguments in QueryableMethodNormalizingExpressionVisitor after …
roji Nov 3, 2023
fa442a2
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 4, 2023
fbb45f2
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 5, 2023
ebc6345
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Nov 6, 2023
dfedecc
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 6, 2023
b06f376
Replace explicit richCodeNavigationEnvironment in azure-pipelines-ric…
akoeplinger Nov 6, 2023
18af811
Revert to latest public preview of the .NET SDK (#32203)
bricelam Nov 6, 2023
e4ff864
Merge branch 'release/8.0'
ajcvickers Nov 6, 2023
9ea08b9
Scaffolding: Handle unknown computed column SQL in model factory (#32…
bricelam Nov 8, 2023
15413f5
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 8, 2023
684b1be
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 8, 2023
d7cd6f3
Update branding to 8.0.1 (#32250)
vseanreesermsft Nov 8, 2023
3b95d44
Update branding to 7.0.15 (#32249)
vseanreesermsft Nov 8, 2023
0c609ff
Update branding to 6.0.26 (#32248)
vseanreesermsft Nov 8, 2023
650e496
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Nov 9, 2023
3eb3356
Merge branch 'release/6.0' into release/7.0
ajcvickers Nov 9, 2023
eadaa7f
Merge branch 'release/7.0' into release/8.0
ajcvickers Nov 9, 2023
b889ad1
Merge branch 'release/8.0'
ajcvickers Nov 9, 2023
c1faee1
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 9, 2023
255d58f
Merge branch 'main' of https://github.com/dotnet/efcore
ajcvickers Nov 9, 2023
e6fb36c
Take into account Contains item visitation in SqlNullabilityProcessor…
roji Nov 13, 2023
bef191e
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Nov 13, 2023
7c8127b
Visit arguments in QueryableMethodNormalizingExpressionVisitor after …
roji Nov 13, 2023
a60c399
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 13, 2023
fff995f
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Nov 13, 2023
e3e7a5b
Temporal table migrations refactor. (#32239)
maumar Nov 13, 2023
64ba990
Improve some exception messages. (#32260)
AndriySvyryd Nov 14, 2023
0db7891
[release/8.0] Fix to #32235 - Buffering error in JSON deserialization…
maumar Nov 14, 2023
430da19
[release/8.0] Stop throwing for complex type properties when sensitiv…
ajcvickers Nov 14, 2023
ac46968
Merge branch 'release/8.0'
ajcvickers Nov 14, 2023
ef76322
Remove quirks (#32292)
ajcvickers Nov 14, 2023
849b881
Merge commit '31662b30f1a4497db482b3aed8ed4c4aa6de801b' into internal…
vseanreesermsft Nov 14, 2023
ad649c5
Merge commit 'ebac2284d2825218fa91c188a3f428f244aa6fe3' into internal…
vseanreesermsft Nov 14, 2023
541aa86
Merge commit 'e017dc125bef2f604f85befd8ff27544a5a67c38' into internal…
vseanreesermsft Nov 14, 2023
32e4519
Add more tests for ConventionSet and fix the found issues. (#32220)
AndriySvyryd Nov 14, 2023
b540658
Make ModelBuilderTest asserts more robust and extensible (#32221)
AndriySvyryd Nov 14, 2023
17aa7f7
Update to .NET 8 GA (#32298)
bricelam Nov 14, 2023
45a8556
Update global.json
wtgodbe Nov 14, 2023
b354ebe
Update global.json
wtgodbe Nov 14, 2023
3af03d8
Update global.json
wtgodbe Nov 14, 2023
eb1d271
Merge pull request #32296 from vseanreesermsft/internal-merge-6.0-202…
wtgodbe Nov 14, 2023
bbb0a35
Merge pull request #32297 from vseanreesermsft/internal-merge-8.0-202…
wtgodbe Nov 14, 2023
4e63f03
Merge pull request #32295 from vseanreesermsft/internal-merge-7.0-202…
wtgodbe Nov 14, 2023
79deed1
Adjust test class names and namespaces (#32289)
AndriySvyryd Nov 15, 2023
73ea00a
Merge branch 'release/6.0' into release/7.0
ajcvickers Nov 15, 2023
4d6a644
Merge branch 'release/7.0' into release/8.0
ajcvickers Nov 15, 2023
54e0df0
Merge branch 'release/8.0'
ajcvickers Nov 15, 2023
2be6f1d
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Nov 15, 2023
5d1235a
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Nov 15, 2023
f55b4a0
Add primitive collection regression test (#32330)
roji Nov 17, 2023
6980d92
[release/8.0] Fix to #32217 - Nav expansion visitor does not visit th…
maumar Nov 17, 2023
1e32073
Fix to #29902 - Renaming PeriodStart and PeriodEnd columns of a tempo…
maumar Nov 17, 2023
c818a11
Rename solution to EFCore.sln (#32344)
roji Nov 20, 2023
47a995d
Do extra processing for init-only fields (#32342)
ajcvickers Nov 20, 2023
1727a68
Make ILazyLoader not IDisposable (#32345)
ajcvickers Nov 20, 2023
f0e09e5
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Nov 20, 2023
a635547
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 20, 2023
ccf749a
Bump Microsoft.AspNetCore.Identity.EntityFrameworkCore from 7.0.13 to…
dependabot[bot] Nov 20, 2023
5488f27
Don't throw when attempting to load from a newly Added entity with un…
ajcvickers Nov 20, 2023
47505c3
Make default value '{}' for non-nullable JSON columns (#32354)
roji Nov 20, 2023
3d0512a
[release/8.0] Do extra processing for init-only fields (#32342) (#32355)
ajcvickers Nov 20, 2023
32e1d6f
Merge branch 'release/8.0'
ajcvickers Nov 20, 2023
1a7c80d
Bump Azure.Identity from 1.10.3 to 1.10.4 (#32361)
dependabot[bot] Nov 21, 2023
b848bf1
Fix typos, doubled words (#32372)
petterh Nov 21, 2023
b385818
Move compiled model tests to EFCore.Specification.Tests (#32341)
AndriySvyryd Nov 21, 2023
0386645
[release/8.0] Don't throw when attempting to load from a newly Added …
ajcvickers Nov 21, 2023
25ba437
Fix to #32154 - Convert_regular_column_of_temporal_table_to_sparse fa…
maumar Nov 21, 2023
e6291bf
[release/7.0] Fix to #31448 Use token for NonQueryResultAsync (#31449…
roji Nov 21, 2023
141740f
Merge branch 'release/7.0' into release/8.0
ajcvickers Nov 22, 2023
1b59013
Merge branch 'release/8.0'
ajcvickers Nov 22, 2023
84505e3
Stop keeping a reference to the model in LazyLoader instances and the…
ajcvickers Nov 23, 2023
c5262bb
Correctly parse JSON from string (#32393)
ajcvickers Nov 23, 2023
aa97ce4
Do nameof() over DateOnly instead of DateTime (#32415)
roji Nov 27, 2023
01a470c
Allow empty inline collections (#32414)
roji Nov 27, 2023
c61a8c1
Handle shadow navigations when loading with split queries (#32396)
ajcvickers Nov 27, 2023
4567312
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Nov 27, 2023
2f1c943
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Nov 27, 2023
484a3ed
Implement EF.Constant (#32412)
roji Nov 27, 2023
d79cd19
Work on LEAST/GREATEST, Math.Min/Max (#32338)
roji Nov 28, 2023
1f82d4d
Remove no-longer-needed unwrapping of AsQueryable (#32429)
roji Nov 28, 2023
d49e211
Implement EF.Parameter (#32427)
roji Nov 28, 2023
74cc719
Add method postfix when rewriting parameters for StartsWith/EndsWith/…
roji Nov 28, 2023
b96c768
Fix to #27844 - EF Core 6.0 temporal table migration when altering co…
maumar Nov 29, 2023
78214da
Create correct JSON reader/writer for double nested value conversions…
ajcvickers Nov 29, 2023
c040b11
Switch to HashSet in LazyLoader (#32445)
AndriySvyryd Nov 29, 2023
caaf394
Add missing ConfigureAwait(false) on await foreach (#32450)
roji Nov 29, 2023
17fa62f
Allow ignored key values for fixup before saving using TPT (#32439)
ajcvickers Nov 30, 2023
50a8ae5
Visit inside InlineQueryRootExpression in nav expansion (#32460)
roji Nov 30, 2023
3ebc2ca
[release/8.0; Test only] Make Cosmos EnsureCreated tests run async on…
ajcvickers Dec 1, 2023
6632487
Merge branch 'release/8.0'
ajcvickers Dec 1, 2023
98d7065
Cosmos: Generate ordinal values for key properties that used not to b…
AndriySvyryd Dec 1, 2023
8743cd5
Update DailyBuilds.md for EF9 (#32470)
AndriySvyryd Dec 1, 2023
32c6133
Use current value in update pipeline when original value is not being…
ajcvickers Dec 2, 2023
cf5ec40
Fix expression cloning when table changes in SelectExpression.VisitCh…
roji Dec 3, 2023
5533b74
Attempt to reduce flakiness in ExecuteReader_throws_when_busy tests (…
ajcvickers Dec 4, 2023
f104409
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Dec 4, 2023
e1594af
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Dec 4, 2023
1048f6a
Infer type mapping suitable for concatenating two results (#32510)
ajcvickers Dec 4, 2023
cfcdf56
Fix Contains within SQL Server aggregate functions (#32478)
roji Dec 4, 2023
9d84cf4
Revert behavior to throw when attempting to modify an unconstrained a…
ajcvickers Dec 5, 2023
e84696d
Update Grpc.AspNetCore (#32500)
ajcvickers Dec 5, 2023
e72bde5
Make proxies thread-safe accessing a navigation once loaded (#32522)
ajcvickers Dec 7, 2023
e84e5ad
Allow specifying Assembly for migrations (#32473)
davidnajar Dec 7, 2023
9d68988
Move ModelBuilding tests to EFCore.Specification.Tests (#32530)
AndriySvyryd Dec 7, 2023
679b311
Add DbContextOptions composibility support
AndriySvyryd Dec 8, 2023
5a4ffe6
Fix splitting migrations SQL by GO (#32548)
ajcvickers Dec 8, 2023
db9846d
Test new sqlite3mc SQLitePCLRaw bundle (#32562)
ajcvickers Dec 8, 2023
5d88b84
Allow the last DbContext to be registered to use nongeneric options (…
AndriySvyryd Dec 8, 2023
d1124fa
Fix to #1015 - Remove QueryBugsTest class (#32542)
maumar Dec 8, 2023
fd576b9
Ensure that, by convention, dependent properties have the same elemen…
ajcvickers Dec 9, 2023
9af27b0
Don't consider a generated value stable just because it was explicitl…
ajcvickers Dec 10, 2023
c57c334
Stop re-using the same connection when running test queries in parall…
ajcvickers Dec 11, 2023
7176495
Ensure connection and commands can be disposed in either order (#32581)
ajcvickers Dec 11, 2023
06c2cae
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Dec 11, 2023
22541af
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Dec 11, 2023
aba897a
Revert the nongeneric DbContextOptions registration (#32579)
AndriySvyryd Dec 11, 2023
4f1cd17
Improve the relationship cycle breaking logic to detect cycles even w…
AndriySvyryd Dec 11, 2023
a376787
Generate more information when failing to load EntityTypeConfiguratio…
ajcvickers Dec 12, 2023
f67d745
Validate scaffolding migration file names (#32589)
ajcvickers Dec 12, 2023
fb82304
Fix some API docs (#32594)
AndriySvyryd Dec 12, 2023
a936d32
Fix relationship cycle breaking logic in CSharpRuntimeModelCodeGenera…
AndriySvyryd Dec 12, 2023
8c54538
Pass 'OBJECT' to sp_rename when renaming a table or sequence (#32599)
ajcvickers Dec 13, 2023
bc81ee6
Update target framework to reflect reality (#32602)
ErikEJ Dec 13, 2023
8e67582
Check value converter configuration source when setting element type …
AndriySvyryd Dec 14, 2023
5bceb5e
Scaffolding Change -d option to -m, since -d no longer works (#32606)
ajcvickers Dec 14, 2023
555421e
Fix concurrency issues with SQLite pooling (#32615)
ajcvickers Dec 14, 2023
b01ea2f
Update screenshot used in DailyBuilds.md (#32604)
Tim-Maes Dec 14, 2023
8d78860
Update developer docs for building packages and using developer build…
ajcvickers Dec 15, 2023
cb14437
Microsoft.Data.Sqlite: Check error code when binding parameters (#32613)
ajcvickers Dec 15, 2023
e16a057
Generate the correct type in snapshot when a property has a value con…
AndriySvyryd Dec 15, 2023
404fca5
Allow to configure Cosmos without specifying connection details. (#32…
AndriySvyryd Dec 15, 2023
9b0f169
Don't detect join table with other incoming references as a simple jo…
ajcvickers Dec 16, 2023
209865e
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Dec 18, 2023
a36839f
Don't keep join entity type around because a ForeignKeyAttribute used…
AndriySvyryd Dec 19, 2023
8e4dc09
Make ITableMappingBase.IncludesDerivedTypes null if there are no deri…
AndriySvyryd Dec 19, 2023
85c16d5
Allow generated class members to have same name as generated classes …
ajcvickers Dec 20, 2023
fff96a3
Additional testing transforming the database model to the IModel that…
ajcvickers Dec 20, 2023
02f1c43
Singulaize before checking for CSharp name conflicts (#32641)
ajcvickers Dec 20, 2023
2d7ed26
Microsoft.Data.Sqlite: Don't assume nullabilty or uniqueness of proje…
ajcvickers Dec 20, 2023
5defd88
Refactor queryable collection support for non-relational providers (#…
roji Dec 23, 2023
040fe9a
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Dec 25, 2023
651d5b9
Redo SQL tree pruning (#32672)
roji Dec 29, 2023
e093b2c
Track prunability of inner joins on the expression itself (#32674)
roji Dec 30, 2023
b9a43a9
Tiny cleanup in SelectExpression.ApplyPredicate (#32688)
roji Dec 30, 2023
2e7ea62
Prune SQL Server OPENJSON's WITH clause (#32673)
roji Dec 30, 2023
566b241
Clean up and open table cloning logic (#32665)
roji Jan 2, 2024
414d9c3
Fix to #32570 - Test/Cleanup: some adhoc tests that are provider only…
maumar Jan 3, 2024
c385d2b
wip test JSON_VALUE provider.
joelmandell Jan 7, 2023
7ea3a09
DbFunctions: JSON_VALUE & JSON_QUERY support MSSQL.
joelmandell Jan 9, 2023
4d8ddea
Additional test for JsonValue and JsonQuery DbFunctions.
joelmandell Jan 9, 2023
1422e57
Added support for json_extract for Sqlite provider (DbFunction).
joelmandell Jan 9, 2023
fc730cc
Fixes according to suggestions (i.e. comments, doc)
joelmandell Jan 29, 2023
3f2b1fe
Fix suggestions for json_extract.
joelmandell Jan 29, 2023
7ae58de
Do not infer type mapping. Null-check.
joelmandell Jan 29, 2023
2c6fcb4
Update src/EFCore.SqlServer/Query/Internal/SqlServerJsonFunctionsTran…
joelmandell Mar 29, 2023
7f110e3
Update src/EFCore.SqlServer/Query/Internal/SqlServerJsonFunctionsTran…
joelmandell Mar 29, 2023
46ec69b
fix formatting
joelmandell Mar 29, 2023
7376009
fix formatting
joelmandell Mar 29, 2023
27c7bd0
make dictionary static
joelmandell Mar 29, 2023
d5a888c
Fix formatting
joelmandell Mar 29, 2023
cb2bbc8
Fix formatting
joelmandell Mar 29, 2023
02f9f37
Fix formatting
joelmandell Mar 29, 2023
571cc11
wip overload jsonextract.
joelmandell Jul 3, 2023
5b2ae4e
Json_Extract overload. Fix formating. Move tests to correct place.
joelmandell Jul 14, 2023
ee39973
Merge branch 'feature/translate_json_functions' of https://github.com…
joelmandell Jan 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/EFCore.SqlServer/Extensions/SqlServerDbFunctionsExtensions.cs
Expand Up @@ -16,6 +16,44 @@ namespace Microsoft.EntityFrameworkCore;
/// </remarks>
public static class SqlServerDbFunctionsExtensions
{
/// <summary>
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
/// Extracts a scalar value from a JSON string. <paramref name="propertyReference" /> and <paramref name="path" />.
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
/// Corresponds to SQL Server's <c>JSON_VALUE(@propertyReference, @path)</c>.
/// </summary>
/// <remarks>
/// See <see href="https://aka.ms/efcore-docs-database-functions">Database functions</see>, and
/// <see href="https://aka.ms/efcore-docs-sqlserver">Accessing SQL Server and SQL Azure databases with EF Core</see>
/// for more information and examples.
/// </remarks>
/// <param name="_">The <see cref="DbFunctions" /> instance.</param>
/// <param name="propertyReference">The property in table</param>
/// <param name="path">The json path.</param>
/// <returns>Value of path</returns>
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
public static string JsonValue(
this DbFunctions _,
object propertyReference,
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
string path)
=> throw new InvalidOperationException(CoreStrings.FunctionOnClient(nameof(SqlServerDbFunctionsExtensions.JsonValue)));

/// <summary>
/// Extracts an object or an array from a JSON string. <paramref name="propertyReference" /> and <paramref name="path" />.
/// Corresponds to SQL Server's <c>JSON_VALUE(@propertyReference, @path)</c>.
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
/// <remarks>
/// See <see href="https://aka.ms/efcore-docs-database-functions">Database functions</see>, and
/// <see href="https://aka.ms/efcore-docs-sqlserver">Accessing SQL Server and SQL Azure databases with EF Core</see>
/// for more information and examples.
/// </remarks>
/// <param name="_">The <see cref="DbFunctions" /> instance.</param>
/// <param name="propertyReference">The property in table</param>
/// <param name="path">The json path.</param>
/// <returns>Value of path</returns>
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
public static string JsonQuery(
this DbFunctions _,
object propertyReference,
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
string path)
=> throw new InvalidOperationException(CoreStrings.FunctionOnClient(nameof(SqlServerDbFunctionsExtensions.JsonQuery)));

/// <summary>
/// A DbFunction method stub that can be used in LINQ queries to target the SQL Server <c>FREETEXT</c> store function.
/// </summary>
Expand Down
@@ -0,0 +1,79 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.EntityFrameworkCore.Query.SqlExpressions;

namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal;

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public class SqlServerJsonFunctionsTranslator : IMethodCallTranslator
{

joelmandell marked this conversation as resolved.
Show resolved Hide resolved
private readonly Dictionary<MethodInfo, string> _methodInfoJsonFunctions
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
= new()
{
{
typeof(SqlServerDbFunctionsExtensions).GetRuntimeMethod(nameof(SqlServerDbFunctionsExtensions.JsonValue), new[] { typeof(DbFunctions), typeof(object), typeof(string) })!,
"JSON_VALUE"
},
{
typeof(SqlServerDbFunctionsExtensions).GetRuntimeMethod(nameof(SqlServerDbFunctionsExtensions.JsonQuery), new[] { typeof(DbFunctions), typeof(object), typeof(string) })!,
"JSON_QUERY"
},
};

private readonly ISqlExpressionFactory _sqlExpressionFactory;


/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public SqlServerJsonFunctionsTranslator(
ISqlExpressionFactory sqlExpressionFactory)
{
_sqlExpressionFactory = sqlExpressionFactory;
}

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public SqlExpression? Translate(
SqlExpression? instance,
MethodInfo method,
IReadOnlyList<SqlExpression> arguments,
IDiagnosticsLogger<DbLoggerCategory.Query> logger)
{
if (_methodInfoJsonFunctions.TryGetValue(method, out var function))
{
var propertyReference = arguments[1];
joelmandell marked this conversation as resolved.
Show resolved Hide resolved

joelmandell marked this conversation as resolved.
Show resolved Hide resolved
var typeMapping = propertyReference.TypeMapping;
var path = propertyReference.Type == arguments[2].Type
? _sqlExpressionFactory.ApplyTypeMapping(arguments[2], typeMapping)
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
: _sqlExpressionFactory.ApplyDefaultTypeMapping(arguments[2]);

var functionArguments = new List<SqlExpression> { propertyReference, path };

return _sqlExpressionFactory.Function(
function,
functionArguments,
nullable: true,
// TODO: don't propagate for now
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
argumentsPropagateNullability: functionArguments.Select(_ => false).ToList(),
typeof(string));
}

return null;
}
}
Expand Up @@ -29,6 +29,7 @@ public SqlServerMethodCallTranslatorProvider(RelationalMethodCallTranslatorProvi
new SqlServerConvertTranslator(sqlExpressionFactory),
new SqlServerDataLengthFunctionTranslator(sqlExpressionFactory),
new SqlServerDateDiffFunctionsTranslator(sqlExpressionFactory),
new SqlServerJsonFunctionsTranslator(sqlExpressionFactory),
new SqlServerDateTimeMethodTranslator(sqlExpressionFactory, typeMappingSource),
new SqlServerFromPartsFunctionTranslator(sqlExpressionFactory, typeMappingSource),
new SqlServerFullTextSearchFunctionsTranslator(sqlExpressionFactory),
Expand Down
17 changes: 17 additions & 0 deletions src/EFCore.Sqlite.Core/Extensions/SqliteDbFunctionsExtensions.cs
Expand Up @@ -30,6 +30,23 @@ public static class SqliteDbFunctionsExtensions
public static bool Glob(this DbFunctions _, string matchExpression, string pattern)
=> throw new InvalidOperationException(CoreStrings.FunctionOnClient(nameof(Glob)));


/// <summary>
/// Maps to the SQLite <c>json_extract</c> function, which extracts and returns one or more values from well-formed JSON.
/// </summary>
/// <remarks>
/// See <see href="https://aka.ms/efcore-docs-database-functions">Database functions</see>, and
/// <see href="https://aka.ms/efcore-docs-sqlite">Accessing SQLite databases with EF Core</see> for more information and examples.
/// </remarks>
/// <param name="_">The <see cref="DbFunctions" /> instance.</param>
/// <param name="propertyReference">The column</param>
/// /// <param name="paths">The column</param>
/// <returns>A hexadecimal string.</returns>
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
public static string JsonExtract(this DbFunctions _,
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
object propertyReference,
string paths)
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
=> throw new InvalidOperationException(CoreStrings.FunctionOnClient(nameof(JsonExtract)));

/// <summary>
/// Maps to the SQLite <c>hex</c> function which returns a hexadecimal string representing the specified value.
/// </summary>
Expand Down
@@ -0,0 +1,76 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.EntityFrameworkCore.Query.SqlExpressions;

namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal;

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public class SqliteJsonFunctionsTranslator : IMethodCallTranslator
{

joelmandell marked this conversation as resolved.
Show resolved Hide resolved
private readonly Dictionary<MethodInfo, string> _methodInfoJsonFunctions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a bit excessive to have a dictionary here for just one method, you can just have a single static property and compare to it directly below.

= new()
{
{
typeof(SqliteDbFunctionsExtensions).GetRuntimeMethod(nameof(SqliteDbFunctionsExtensions.JsonExtract), new[] { typeof(DbFunctions), typeof(object), typeof(string) })!,
"json_extract"
}
};

private readonly ISqlExpressionFactory _sqlExpressionFactory;


/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public SqliteJsonFunctionsTranslator(
ISqlExpressionFactory sqlExpressionFactory)
{
_sqlExpressionFactory = sqlExpressionFactory;
}

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public SqlExpression? Translate(
SqlExpression? instance,
MethodInfo method,
IReadOnlyList<SqlExpression> arguments,
IDiagnosticsLogger<DbLoggerCategory.Query> logger)
{
if (_methodInfoJsonFunctions.TryGetValue(method, out var function))
{
var propertyReference = arguments[1];
joelmandell marked this conversation as resolved.
Show resolved Hide resolved

var typeMapping = propertyReference.TypeMapping;

var path = propertyReference.Type == arguments[2].Type
? _sqlExpressionFactory.ApplyTypeMapping(arguments[2], typeMapping)
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
: _sqlExpressionFactory.ApplyDefaultTypeMapping(arguments[2]);

var functionArguments = new List<SqlExpression> { propertyReference, path };

return _sqlExpressionFactory.Function(
function,
functionArguments,
nullable: true,
// TODO: don't propagate for now
joelmandell marked this conversation as resolved.
Show resolved Hide resolved
argumentsPropagateNullability: functionArguments.Select(_ => false).ToList(),
typeof(string));
}

return null;
}
}
Expand Up @@ -29,6 +29,7 @@ public SqliteMethodCallTranslatorProvider(RelationalMethodCallTranslatorProvider
new SqliteCharMethodTranslator(sqlExpressionFactory),
new SqliteDateTimeAddTranslator(sqlExpressionFactory),
new SqliteGlobMethodTranslator(sqlExpressionFactory),
new SqliteJsonFunctionsTranslator(sqlExpressionFactory),
new SqliteHexMethodTranslator(sqlExpressionFactory),
new SqliteMathTranslator(sqlExpressionFactory),
new SqliteObjectToStringTranslator(sqlExpressionFactory),
Expand Down
@@ -0,0 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.EntityFrameworkCore.TestModels.JsonQuery;
public class JsonEntityBasicString
Copy link
Member

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?

Copy link
Author

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.

{
public int Id { get; set; }
public string Name { get; set; }

public string OwnedReferenceRoot { get; set; }
}
Expand Up @@ -12,6 +12,8 @@ public JsonQueryContext(DbContextOptions options)

public DbSet<EntityBasic> EntitiesBasic { get; set; }
public DbSet<JsonEntityBasic> JsonEntitiesBasic { get; set; }
public DbSet<JsonEntityBasicString> JsonEntitiesBasicString { get; set; }

public DbSet<JsonEntityBasicForReference> JsonEntitiesBasicForReference { get; set; }
public DbSet<JsonEntityBasicForCollection> JsonEntitiesBasicForCollection { get; set; }
public DbSet<JsonEntityCustomNaming> JsonEntitiesCustomNaming { get; set; }
Expand All @@ -22,6 +24,7 @@ public JsonQueryContext(DbContextOptions options)
public static void Seed(JsonQueryContext context)
{
var jsonEntitiesBasic = JsonQueryData.CreateJsonEntitiesBasic();
var jsonEntitiesBasicStrings = JsonQueryData.CreateJsonEntitiesBasicString();
var jsonEntitiesBasicForReference = JsonQueryData.CreateJsonEntitiesBasicForReference();
var jsonEntitiesBasicForCollection = JsonQueryData.CreateJsonEntitiesBasicForCollection();
JsonQueryData.WireUp(jsonEntitiesBasic, jsonEntitiesBasicForReference, jsonEntitiesBasicForCollection);
Expand All @@ -32,6 +35,7 @@ public static void Seed(JsonQueryContext context)
var jsonEntitiesAllTypes = JsonQueryData.CreateJsonEntitiesAllTypes();

context.JsonEntitiesBasic.AddRange(jsonEntitiesBasic);
context.JsonEntitiesBasicString.AddRange(jsonEntitiesBasicStrings);
context.JsonEntitiesBasicForReference.AddRange(jsonEntitiesBasicForReference);
context.JsonEntitiesBasicForCollection.AddRange(jsonEntitiesBasicForCollection);
context.JsonEntitiesCustomNaming.AddRange(jsonEntitiesCustomNaming);
Expand Down
Expand Up @@ -9,6 +9,7 @@ public JsonQueryData()
{
EntitiesBasic = new List<EntityBasic>();
JsonEntitiesBasic = CreateJsonEntitiesBasic();
JsonEntitiesBasicStrings = CreateJsonEntitiesBasicString();
JsonEntitiesBasicForReference = CreateJsonEntitiesBasicForReference();
JsonEntitiesBasicForCollection = CreateJsonEntitiesBasicForCollection();
WireUp(JsonEntitiesBasic, JsonEntitiesBasicForReference, JsonEntitiesBasicForCollection);
Expand All @@ -21,13 +22,25 @@ public JsonQueryData()

public IReadOnlyList<EntityBasic> EntitiesBasic { get; }
public IReadOnlyList<JsonEntityBasic> JsonEntitiesBasic { get; }
public IReadOnlyList<JsonEntityBasicString> JsonEntitiesBasicStrings { get; }

public IReadOnlyList<JsonEntityBasicForReference> JsonEntitiesBasicForReference { get; }
public IReadOnlyList<JsonEntityBasicForCollection> JsonEntitiesBasicForCollection { get; }
public IReadOnlyList<JsonEntityCustomNaming> JsonEntitiesCustomNaming { get; set; }
public IReadOnlyList<JsonEntitySingleOwned> JsonEntitiesSingleOwned { get; set; }
public IReadOnlyList<JsonEntityInheritanceBase> JsonEntitiesInheritance { get; set; }
public IReadOnlyList<JsonEntityAllTypes> JsonEntitiesAllTypes { get; set; }


public static IReadOnlyList<JsonEntityBasicString> CreateJsonEntitiesBasicString()
{
var entity = new JsonEntityBasicString();
entity.Name = "Testing SQL Json-functions.";
entity.OwnedReferenceRoot = "{\"Name\":\"e1_r\",\"Number\":10,\"OwnedCollectionBranch\":[{\"Date\":\"2101-01-01T00:00:00\",\"Enum\":\"Two\",\"Fraction\":10.1,\"NullableEnum\":\"One\",\"OwnedCollectionLeaf\":[{\"SomethingSomething\":\"e1_r_c1_c1\"},{\"SomethingSomething\":\"e1_r_c1_c2\"}],\"OwnedReferenceLeaf\":{\"SomethingSomething\":\"e1_r_c1_r\"}},{\"Date\":\"2102-01-01T00:00:00\",\"Enum\":\"Three\",\"Fraction\":10.2,\"NullableEnum\":\"Two\",\"OwnedCollectionLeaf\":[{\"SomethingSomething\":\"e1_r_c2_c1\"},{\"SomethingSomething\":\"e1_r_c2_c2\"}],\"OwnedReferenceLeaf\":{\"SomethingSomething\":\"e1_r_c2_r\"}}],\"OwnedReferenceBranch\":{\"Date\":\"2100-01-01T00:00:00\",\"Enum\":\"One\",\"Fraction\":10.0,\"NullableEnum\":null,\"OwnedCollectionLeaf\":[{\"SomethingSomething\":\"e1_r_r_c1\"},{\"SomethingSomething\":\"e1_r_r_c2\"}],\"OwnedReferenceLeaf\":{\"SomethingSomething\":\"e1_r_r_r\"}}}";

return new List<JsonEntityBasicString>() { entity };
}

public static IReadOnlyList<JsonEntityBasic> CreateJsonEntitiesBasic()
{
//-------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -776,6 +789,11 @@ public IQueryable<TEntity> Set<TEntity>()
return (IQueryable<TEntity>)JsonEntitiesBasic.AsQueryable();
}

if (typeof(TEntity) == typeof(JsonEntityBasicString))
{
return (IQueryable<TEntity>)JsonEntitiesBasicStrings.AsQueryable();
}

if (typeof(TEntity) == typeof(JsonEntityCustomNaming))
{
return (IQueryable<TEntity>)JsonEntitiesCustomNaming.AsQueryable();
Expand Down