diff --git a/.devcontainer/dockerfile b/.devcontainer/dockerfile index 65d5a664a22..e05c01b1168 100644 --- a/.devcontainer/dockerfile +++ b/.devcontainer/dockerfile @@ -24,13 +24,14 @@ EXPOSE 22 # Start SSH service CMD ["/usr/sbin/sshd", "-D"] -# Install .NET SDKs (6, 7, 8 and 9) +# Install .NET SDKs (6, 7, 8, 9, and 10) RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \ && chmod +x dotnet-install.sh \ && ./dotnet-install.sh --channel 6.0 --install-dir /usr/share/dotnet \ && ./dotnet-install.sh --channel 7.0 --install-dir /usr/share/dotnet \ && ./dotnet-install.sh --channel 8.0 --install-dir /usr/share/dotnet \ && ./dotnet-install.sh --channel 9.0 --install-dir /usr/share/dotnet \ + && ./dotnet-install.sh --channel 10.0 --install-dir /usr/share/dotnet \ && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet # Install Node.js LTS @@ -56,4 +57,4 @@ RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | # Clean up RUN rm dotnet-install.sh \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ No newline at end of file + && rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fca886a1510..f77ce592592 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,7 +148,7 @@ jobs: - name: Install .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 9.x + dotnet-version: 10.x - name: Generate Test Matrix run: dotnet run --project ./.build -- GenerateMatrix @@ -181,10 +181,11 @@ jobs: dotnet-version: | 8.x 9.x + 10.x - name: Run Build id: run-build - run: dotnet build ${{ matrix.path }} --framework net9.0 --verbosity q + run: dotnet build ${{ matrix.path }} --framework net10.0 --verbosity q timeout-minutes: 5 - name: Log in to Docker Hub @@ -205,7 +206,7 @@ jobs: run: > dotnet test ${{ matrix.path }} --collect:"XPlat Code Coverage;Format=opencover" - --framework net9.0 + --framework net10.0 --logger trx --no-build -- diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f78a937dd99..d6777e25a00 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -32,6 +32,7 @@ jobs: dotnet-version: | 8.x 9.x + 10.x - name: Generate Test Matrix run: dotnet run --project ./.build -- GenerateMatrix @@ -63,10 +64,11 @@ jobs: dotnet-version: | 8.x 9.x + 10.x - name: Run Build id: run-build - run: dotnet build ${{ matrix.path }} --framework net9.0 --verbosity q + run: dotnet build ${{ matrix.path }} --framework net10.0 --verbosity q timeout-minutes: 5 - name: Log in to Docker Hub @@ -82,7 +84,7 @@ jobs: run: > dotnet test ${{ matrix.path }} --collect:"XPlat Code Coverage;Format=opencover" - --framework net9.0 + --framework net10.0 --logger trx --no-build --verbosity q diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d93dfd97bb..da8171c28c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,7 @@ jobs: dotnet-version: | 8.x 9.x + 10.x - name: 🏷 Get the version from tag id: get_version @@ -102,7 +103,7 @@ jobs: - name: 🛠 Install .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 9.x + dotnet-version: 10.x - name: 🧩 Publish AOT Binary for ${{ matrix.rid }} shell: bash @@ -110,10 +111,10 @@ jobs: dotnet publish ./src/HotChocolate/Fusion-vnext/src/Fusion.CommandLine \ -c Release \ -r ${{ matrix.rid }} \ - -f net9.0 \ + -f net10.0 \ --self-contained true \ -p:PublishAot=true \ - -p:TargetFrameworks=NET9.0 \ + -p:TargetFrameworks=NET10.0 \ -o ./publish - name: 📦 Zip Binary (Windows) diff --git a/build.sh b/build.sh index 959027fe6ce..a71c9501975 100755 --- a/build.sh +++ b/build.sh @@ -41,8 +41,9 @@ else DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" # install older frameworks for tests - "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "8.0.404" --no-path - "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "9.0.100" --no-path + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "8.0.408" --no-path + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "9.0.203" --no-path + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "10.0.100-preview.4.25258.110" --no-path # If global.json exists, load expected version if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then diff --git a/global.json b/global.json index 72e9873166b..e9928db5b47 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.200", + "version": "10.0.100-preview.4.25258.110", "rollForward": "latestMinor" } } diff --git a/src/CookieCrumble/src/CookieCrumble.TUnit/CookieCrumble.TUnit.csproj b/src/CookieCrumble/src/CookieCrumble.TUnit/CookieCrumble.TUnit.csproj index 5d0fcdce1fb..8d69f936641 100644 --- a/src/CookieCrumble/src/CookieCrumble.TUnit/CookieCrumble.TUnit.csproj +++ b/src/CookieCrumble/src/CookieCrumble.TUnit/CookieCrumble.TUnit.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumble.Xunit.csproj b/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumble.Xunit.csproj index b9e5062e13c..a55f8c5c0e7 100644 --- a/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumble.Xunit.csproj +++ b/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumble.Xunit.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj b/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj index caee8700f21..e53ced22b64 100644 --- a/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj +++ b/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj @@ -18,7 +18,7 @@ - + diff --git a/src/CookieCrumble/src/CookieCrumble/Utilities/TestEnvironment.cs b/src/CookieCrumble/src/CookieCrumble/Utilities/TestEnvironment.cs index afef6c96007..8e3a9c56e7f 100644 --- a/src/CookieCrumble/src/CookieCrumble/Utilities/TestEnvironment.cs +++ b/src/CookieCrumble/src/CookieCrumble/Utilities/TestEnvironment.cs @@ -17,6 +17,11 @@ public static class TestEnvironment /// The target framework identifier. /// public const string TargetFramework = "NET9_0"; +#elif NET10_0 + /// + /// The target framework identifier. + /// + public const string TargetFramework = "NET10_0"; #endif public static bool IsLocalEnvironment() diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 0149ca3ab6d..29160549e4a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -8,7 +8,6 @@ true enable enable - direct @@ -44,9 +43,8 @@ - net9.0; net8.0 - net9.0; net8.0; netstandard2.0 - netstandard2.0 + net10.0; net9.0; net8.0 + net10.0; net9.0; net8.0; netstandard2.0 diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index b7df0ee077a..544836158c1 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -10,8 +10,9 @@ - - + + + @@ -55,7 +56,6 @@ - @@ -69,6 +69,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -90,10 +112,6 @@ - - - - @@ -113,13 +131,10 @@ - - - - - + + + - diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/GreenDonut.Data.EntityFramework.Tests.csproj b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/GreenDonut.Data.EntityFramework.Tests.csproj index 6a0b9fc4f10..d4b1212772a 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/GreenDonut.Data.EntityFramework.Tests.csproj +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/GreenDonut.Data.EntityFramework.Tests.csproj @@ -16,7 +16,6 @@ - diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperIntegrationTests.cs b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperIntegrationTests.cs index ad9e483152c..472e45d45a5 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperIntegrationTests.cs +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperIntegrationTests.cs @@ -29,7 +29,8 @@ public async Task Paging_Empty_PagingArgs() var result = await context.Brands.OrderBy(t => t.Name).ThenBy(t => t.Id).ToPageAsync(pagingArgs); // Assert - await CreateSnapshot() + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(capture.Queries) .Add( new @@ -60,7 +61,8 @@ public async Task Paging_First_5() var result = await context.Brands.OrderBy(t => t.Name).ThenBy(t => t.Id).ToPageAsync(pagingArgs); // Assert - await CreateSnapshot() + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(capture.Queries) .Add( new @@ -95,7 +97,8 @@ public async Task Paging_First_5_After_Id_13() var result = await context.Brands.OrderBy(t => t.Name).ThenBy(t => t.Id).ToPageAsync(pagingArgs); // Assert - await CreateSnapshot() + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(capture.Queries) .Add( new @@ -126,7 +129,8 @@ public async Task Paging_Last_5() var result = await context.Brands.OrderBy(t => t.Name).ThenBy(t => t.Id).ToPageAsync(pagingArgs); // Assert - await CreateSnapshot() + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(capture.Queries) .Add( new @@ -163,7 +167,8 @@ public async Task Paging_First_5_Before_Id_96() var result = await context.Brands.OrderBy(t => t.Name).ThenBy(t => t.Id).ToPageAsync(pagingArgs); // Assert - await CreateSnapshot() + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(capture.Queries) .Add( new @@ -202,7 +207,8 @@ public async Task Paging_WithChildCollectionProjectionExpression_First_5() .ToPageAsync(pagingArgs); // Assert - await CreateSnapshot() + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(capture.Queries) .Add( new @@ -222,11 +228,12 @@ await CreateSnapshot() public async Task BatchPaging_First_5() { // Arrange -#if NET8_0 - var snapshot = CreateSnapshot(); -#else - var snapshot = Snapshot.Create("NET9_0"); -#endif + var snapshot = + Snapshot.Create( + postFix: + TestEnvironment.TargetFramework == "NET8_0" + ? TestEnvironment.TargetFramework + : null); var connectionString = CreateConnectionString(); await SeedAsync(connectionString); @@ -264,11 +271,12 @@ public async Task BatchPaging_First_5() public async Task BatchPaging_Last_5() { // Arrange -#if NET8_0 - var snapshot = CreateSnapshot(); -#else - var snapshot = Snapshot.Create("NET9_0"); -#endif + var snapshot = + Snapshot.Create( + postFix: + TestEnvironment.TargetFramework == "NET8_0" + ? TestEnvironment.TargetFramework + : null); var connectionString = CreateConnectionString(); await SeedAsync(connectionString); @@ -305,11 +313,12 @@ public async Task BatchPaging_Last_5() public async Task BatchPaging_With_Relative_Cursor() { // Arrange -#if NET8_0 - var snapshot = CreateSnapshot(); -#else - var snapshot = Snapshot.Create("NET9_0"); -#endif + var snapshot = + Snapshot.Create( + postFix: + TestEnvironment.TargetFramework == "NET8_0" + ? TestEnvironment.TargetFramework + : null); var connectionString = CreateConnectionString(); await SeedAsync(connectionString); @@ -453,13 +462,4 @@ protected override async Task>> LoadBatch .ToBatchPageAsync(t => t.BrandId, pagingArgs, cancellationToken); } } - - private static Snapshot CreateSnapshot() - { -#if NET9_0_OR_GREATER - return Snapshot.Create(); -#else - return Snapshot.Create("NET8_0"); -#endif - } } diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperTests.cs b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperTests.cs index f2cfc2ec440..8a2ba671d9c 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperTests.cs +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperTests.cs @@ -215,7 +215,8 @@ await context.Products .ToPageAsync(arguments); // Assert - CreateSnapshot() + Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(interceptor.Queries) .MatchMarkdown(); } @@ -244,7 +245,8 @@ public async Task QueryContext_Simple_Selector_Include_Brand() .ToPageAsync(arguments); // Assert - CreateSnapshot() + Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(interceptor.Queries) .MatchMarkdown(); } @@ -273,7 +275,8 @@ public async Task QueryContext_Simple_Selector_Include_Brand_Name() .ToPageAsync(arguments); // Assert - CreateSnapshot() + Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(interceptor.Queries) .MatchMarkdown(); } @@ -302,7 +305,8 @@ public async Task QueryContext_Simple_Selector_Include_Product_List() .ToPageAsync(arguments); // Assert - CreateSnapshot() + Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(interceptor.Queries) .MatchMarkdown(); } @@ -500,13 +504,4 @@ private static async Task SeedTestAsync(string connectionString) await context.SaveChangesAsync(); } - - private static Snapshot CreateSnapshot() - { -#if NET9_0_OR_GREATER - return Snapshot.Create(); -#else - return Snapshot.Create("NET8_0"); -#endif - } } diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/RelativeCursorTests.cs b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/RelativeCursorTests.cs index c8bc2219147..4a15e6ba395 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/RelativeCursorTests.cs +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/RelativeCursorTests.cs @@ -42,35 +42,10 @@ 5. Evolvance 6. Futurova */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = second.Index, second.TotalCount, Items = second.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 2, - "TotalCount": 20, - "Items": [ - "Celestara", - "Dynamova" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Brightex' - -- @__value_1='2' - -- @__p_2='3' - SELECT b."Id", b."GroupId", b."Name" - FROM "Brands" AS b - WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) - ORDER BY b."Name", b."Id" - LIMIT @__p_2 - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -104,46 +79,10 @@ 5. Evolvance 6. Futurova */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = second.Index, second.TotalCount, Items = second.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 2, - "TotalCount": 20, - "Items": [ - "Celestara", - "Dynamova" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Brightex' - -- @__value_1='2' - SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" - FROM ( - SELECT b."GroupId" - FROM "Brands" AS b - WHERE b."GroupId" = 1 - GROUP BY b."GroupId" - ) AS b1 - LEFT JOIN ( - SELECT b2."Id", b2."GroupId", b2."Name" - FROM ( - SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row - FROM "Brands" AS b0 - WHERE b0."GroupId" = 1 AND (b0."Name" > @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" > @__value_1)) - ) AS b2 - WHERE b2.row <= 3 - ) AS b3 ON b1."GroupId" = b3."GroupId" - ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -175,36 +114,10 @@ 5. Evolvance <- Page 3 - Item 1 6. Futurova <- Page 3 - Item 2 */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = second.Index, second.TotalCount, Items = second.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 3, - "TotalCount": 20, - "Items": [ - "Evolvance", - "Futurova" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Brightex' - -- @__value_1='2' - -- @__p_3='3' - -- @__p_2='2' - SELECT b."Id", b."GroupId", b."Name" - FROM "Brands" AS b - WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) - ORDER BY b."Name", b."Id" - LIMIT @__p_3 OFFSET @__p_2 - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -238,46 +151,10 @@ 5. Evolvance <- Page 3 - Item 1 6. Futurova <- Page 3 - Item 2 */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = second.Index, second.TotalCount, Items = second.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 3, - "TotalCount": 20, - "Items": [ - "Evolvance", - "Futurova" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Brightex' - -- @__value_1='2' - SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" - FROM ( - SELECT b."GroupId" - FROM "Brands" AS b - WHERE b."GroupId" = 1 - GROUP BY b."GroupId" - ) AS b1 - LEFT JOIN ( - SELECT b2."Id", b2."GroupId", b2."Name" - FROM ( - SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row - FROM "Brands" AS b0 - WHERE b0."GroupId" = 1 AND (b0."Name" > @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" > @__value_1)) - ) AS b2 - WHERE 2 < b2.row AND b2.row <= 5 - ) AS b3 ON b1."GroupId" = b3."GroupId" - ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -313,36 +190,10 @@ 7. Glacient <- Page 4 - Item 1 8. Hyperionix <- Page 4 - Item 2 */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = fourth.Index, fourth.TotalCount, Items = fourth.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 4, - "TotalCount": 20, - "Items": [ - "Glacient", - "Hyperionix" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Dynamova' - -- @__value_1='4' - -- @__p_3='3' - -- @__p_2='2' - SELECT b."Id", b."GroupId", b."Name" - FROM "Brands" AS b - WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) - ORDER BY b."Name", b."Id" - LIMIT @__p_3 OFFSET @__p_2 - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -380,46 +231,10 @@ 7. Glacient <- Page 4 - Item 1 8. Hyperionix <- Page 4 - Item 2 */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = fourth.Index, fourth.TotalCount, Items = fourth.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 4, - "TotalCount": 20, - "Items": [ - "Glacient", - "Hyperionix" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Dynamova' - -- @__value_1='4' - SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" - FROM ( - SELECT b."GroupId" - FROM "Brands" AS b - WHERE b."GroupId" = 1 - GROUP BY b."GroupId" - ) AS b1 - LEFT JOIN ( - SELECT b2."Id", b2."GroupId", b2."Name" - FROM ( - SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row - FROM "Brands" AS b0 - WHERE b0."GroupId" = 1 AND (b0."Name" > @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" > @__value_1)) - ) AS b2 - WHERE 2 < b2.row AND b2.row <= 5 - ) AS b3 ON b1."GroupId" = b3."GroupId" - ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -453,36 +268,10 @@ 7. Glacient <- Page 4 - Item 1 8. Hyperionix <- Page 4 - Item 2 */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = fourth.Index, fourth.TotalCount, Items = fourth.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 4, - "TotalCount": 20, - "Items": [ - "Glacient", - "Hyperionix" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Brightex' - -- @__value_1='2' - -- @__p_3='3' - -- @__p_2='4' - SELECT b."Id", b."GroupId", b."Name" - FROM "Brands" AS b - WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) - ORDER BY b."Name", b."Id" - LIMIT @__p_3 OFFSET @__p_2 - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -518,46 +307,10 @@ 7. Glacient <- Page 4 - Item 1 8. Hyperionix <- Page 4 - Item 2 */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = fourth.Index, fourth.TotalCount, Items = fourth.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 4, - "TotalCount": 20, - "Items": [ - "Glacient", - "Hyperionix" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Brightex' - -- @__value_1='2' - SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" - FROM ( - SELECT b."GroupId" - FROM "Brands" AS b - WHERE b."GroupId" = 1 - GROUP BY b."GroupId" - ) AS b1 - LEFT JOIN ( - SELECT b2."Id", b2."GroupId", b2."Name" - FROM ( - SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row - FROM "Brands" AS b0 - WHERE b0."GroupId" = 1 AND (b0."Name" > @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" > @__value_1)) - ) AS b2 - WHERE 4 < b2.row AND b2.row <= 7 - ) AS b3 ON b1."GroupId" = b3."GroupId" - ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -590,7 +343,7 @@ 19. Synerflux <- Cursor 20. Vertexis */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = secondToLast.Index, @@ -598,32 +351,7 @@ 20. Vertexis Items = secondToLast.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 9, - "TotalCount": 20, - "Items": [ - "Quantumis", - "Radiantum" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Synerflux' - -- @__value_1='19' - -- @__p_2='3' - SELECT b."Id", b."GroupId", b."Name" - FROM "Brands" AS b - WHERE b."Name" < @__value_0 OR (b."Name" = @__value_0 AND b."Id" < @__value_1) - ORDER BY b."Name" DESC, b."Id" DESC - LIMIT @__p_2 - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -658,7 +386,7 @@ 19. Synerflux <- Cursor 20. Vertexis */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = secondToLast.Index, @@ -666,43 +394,7 @@ 20. Vertexis Items = secondToLast.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 9, - "TotalCount": 20, - "Items": [ - "Quantumis", - "Radiantum" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Synerflux' - -- @__value_1='19' - SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" - FROM ( - SELECT b."GroupId" - FROM "Brands" AS b - WHERE b."GroupId" = 2 - GROUP BY b."GroupId" - ) AS b1 - LEFT JOIN ( - SELECT b2."Id", b2."GroupId", b2."Name" - FROM ( - SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row - FROM "Brands" AS b0 - WHERE b0."GroupId" = 2 AND (b0."Name" < @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" < @__value_1)) - ) AS b2 - WHERE b2.row <= 3 - ) AS b3 ON b1."GroupId" = b3."GroupId" - ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -735,7 +427,7 @@ 19. Synerflux <- Cursor 20. Vertexis */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = thirdToLast.Index, @@ -743,33 +435,7 @@ 20. Vertexis Items = thirdToLast.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 8, - "TotalCount": 20, - "Items": [ - "Omniflex", - "Pulsarix" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Synerflux' - -- @__value_1='19' - -- @__p_3='3' - -- @__p_2='2' - SELECT b."Id", b."GroupId", b."Name" - FROM "Brands" AS b - WHERE b."Name" < @__value_0 OR (b."Name" = @__value_0 AND b."Id" < @__value_1) - ORDER BY b."Name" DESC, b."Id" DESC - LIMIT @__p_3 OFFSET @__p_2 - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -804,7 +470,7 @@ 19. Synerflux <- Cursor 20. Vertexis */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = thirdToLast.Index, @@ -812,43 +478,7 @@ 20. Vertexis Items = thirdToLast.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 8, - "TotalCount": 20, - "Items": [ - "Omniflex", - "Pulsarix" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Synerflux' - -- @__value_1='19' - SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" - FROM ( - SELECT b."GroupId" - FROM "Brands" AS b - WHERE b."GroupId" = 2 - GROUP BY b."GroupId" - ) AS b1 - LEFT JOIN ( - SELECT b2."Id", b2."GroupId", b2."Name" - FROM ( - SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row - FROM "Brands" AS b0 - WHERE b0."GroupId" = 2 AND (b0."Name" < @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" < @__value_1)) - ) AS b2 - WHERE 2 < b2.row AND b2.row <= 5 - ) AS b3 ON b1."GroupId" = b3."GroupId" - ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -884,7 +514,7 @@ 19. Synerflux <- Cursor 20. Vertexis */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = thirdToLast.Index, @@ -892,33 +522,7 @@ 20. Vertexis Items = thirdToLast.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 7, - "TotalCount": 20, - "Items": [ - "Momentumix", - "Nebularis" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Synerflux' - -- @__value_1='19' - -- @__p_3='3' - -- @__p_2='4' - SELECT b."Id", b."GroupId", b."Name" - FROM "Brands" AS b - WHERE b."Name" < @__value_0 OR (b."Name" = @__value_0 AND b."Id" < @__value_1) - ORDER BY b."Name" DESC, b."Id" DESC - LIMIT @__p_3 OFFSET @__p_2 - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -956,7 +560,7 @@ 19. Synerflux <- Cursor 20. Vertexis */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = thirdToLast.Index, @@ -964,43 +568,7 @@ 20. Vertexis Items = thirdToLast.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 7, - "TotalCount": 20, - "Items": [ - "Momentumix", - "Nebularis" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Synerflux' - -- @__value_1='19' - SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" - FROM ( - SELECT b."GroupId" - FROM "Brands" AS b - WHERE b."GroupId" = 2 - GROUP BY b."GroupId" - ) AS b1 - LEFT JOIN ( - SELECT b2."Id", b2."GroupId", b2."Name" - FROM ( - SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row - FROM "Brands" AS b0 - WHERE b0."GroupId" = 2 AND (b0."Name" < @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" < @__value_1)) - ) AS b2 - WHERE 4 < b2.row AND b2.row <= 7 - ) AS b3 ON b1."GroupId" = b3."GroupId" - ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -1038,7 +606,7 @@ 19. Synerflux 20. Vertexis */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = fourthToLast.Index, @@ -1046,33 +614,7 @@ 20. Vertexis Items = fourthToLast.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 7, - "TotalCount": 20, - "Items": [ - "Momentumix", - "Nebularis" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Quantumis' - -- @__value_1='17' - -- @__p_3='3' - -- @__p_2='2' - SELECT b."Id", b."GroupId", b."Name" - FROM "Brands" AS b - WHERE b."Name" < @__value_0 OR (b."Name" = @__value_0 AND b."Id" < @__value_1) - ORDER BY b."Name" DESC, b."Id" DESC - LIMIT @__p_3 OFFSET @__p_2 - --------------- - - """); + .MatchSnapshot(); } [Fact] @@ -1112,7 +654,7 @@ 19. Synerflux 20. Vertexis */ - Snapshot.Create() + Snapshot.Create(postFix: TestEnvironment.TargetFramework) .Add(new { Page = fourthToLast.Index, @@ -1120,43 +662,7 @@ 20. Vertexis Items = fourthToLast.Items.Select(t => t.Name).ToArray() }) .AddSql(capture) - .MatchInline( - """ - --------------- - { - "Page": 7, - "TotalCount": 20, - "Items": [ - "Momentumix", - "Nebularis" - ] - } - --------------- - - SQL 0 - --------------- - -- @__value_0='Quantumis' - -- @__value_1='17' - SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" - FROM ( - SELECT b."GroupId" - FROM "Brands" AS b - WHERE b."GroupId" = 2 - GROUP BY b."GroupId" - ) AS b1 - LEFT JOIN ( - SELECT b2."Id", b2."GroupId", b2."Name" - FROM ( - SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row - FROM "Brands" AS b0 - WHERE b0."GroupId" = 2 AND (b0."Name" < @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" < @__value_1)) - ) AS b2 - WHERE 2 < b2.row AND b2.row <= 5 - ) AS b3 ON b1."GroupId" = b3."GroupId" - ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC - --------------- - - """); + .MatchSnapshot(); } [Fact] diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/TestContext/AnimalContext.cs b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/TestContext/AnimalContext.cs index a9556b7d39f..15c76e3ab62 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/TestContext/AnimalContext.cs +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/TestContext/AnimalContext.cs @@ -5,10 +5,10 @@ namespace GreenDonut.Data.TestContext; public class AnimalContext(string connectionString) : DbContext { - public DbSet Owners { get; set; } - public DbSet Pets { get; set; } - public DbSet Dogs { get; set; } - public DbSet Cats { get; set; } + public DbSet Owners { get; set; } = null!; + public DbSet Pets { get; set; } = null!; + public DbSet Dogs { get; set; } = null!; + public DbSet Cats { get; set; } = null!; protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder.UseNpgsql(connectionString); diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/TestContext/FooBarContext.cs b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/TestContext/FooBarContext.cs index b36d2dd8dd2..ead5e457b01 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/TestContext/FooBarContext.cs +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/TestContext/FooBarContext.cs @@ -10,9 +10,9 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) optionsBuilder.UseNpgsql(connectionString); } - public DbSet Foos { get; set; } + public DbSet Foos { get; set; } = null!; - public DbSet Bars { get; set; } + public DbSet Bars { get; set; } = null!; protected override void OnModelCreating(ModelBuilder modelBuilder) { diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_First_5.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_First_5.md index 19a899208b2..14b1e38fe52 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_First_5.md +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_First_5.md @@ -4,8 +4,8 @@ ```json { - "First": "UHJvZHVjdCAwLTA6MQ==", - "Last": "UHJvZHVjdCAwLTE6Mg==", + "First": "e31Qcm9kdWN0IDAtMDox", + "Last": "e31Qcm9kdWN0IDAtMToy", "Items": [ { "Id": 1, @@ -45,8 +45,8 @@ ```json { - "First": "UHJvZHVjdCAxLTA6MTAx", - "Last": "UHJvZHVjdCAxLTE6MTAy", + "First": "e31Qcm9kdWN0IDEtMDoxMDE=", + "Last": "e31Qcm9kdWN0IDEtMToxMDI=", "Items": [ { "Id": 101, @@ -86,8 +86,8 @@ ```json { - "First": "UHJvZHVjdCAyLTA6MjAx", - "Last": "UHJvZHVjdCAyLTE6MjAy", + "First": "e31Qcm9kdWN0IDItMDoyMDE=", + "Last": "e31Qcm9kdWN0IDItMToyMDI=", "Items": [ { "Id": 201, @@ -126,23 +126,23 @@ ## SQL 0 ```sql -SELECT t."BrandId", t0."Id", t0."AvailableStock", t0."BrandId", t0."Description", t0."ImageFileName", t0."MaxStockThreshold", t0."Name", t0."OnReorder", t0."Price", t0."RestockThreshold", t0."TypeId" +SELECT p1."BrandId", p3."Id", p3."AvailableStock", p3."BrandId", p3."Description", p3."ImageFileName", p3."MaxStockThreshold", p3."Name", p3."OnReorder", p3."Price", p3."RestockThreshold", p3."TypeId" FROM ( SELECT p."BrandId" FROM "Products" AS p WHERE p."BrandId" IN (1, 2, 3) GROUP BY p."BrandId" -) AS t +) AS p1 LEFT JOIN ( - SELECT t1."Id", t1."AvailableStock", t1."BrandId", t1."Description", t1."ImageFileName", t1."MaxStockThreshold", t1."Name", t1."OnReorder", t1."Price", t1."RestockThreshold", t1."TypeId" + SELECT p2."Id", p2."AvailableStock", p2."BrandId", p2."Description", p2."ImageFileName", p2."MaxStockThreshold", p2."Name", p2."OnReorder", p2."Price", p2."RestockThreshold", p2."TypeId" FROM ( SELECT p0."Id", p0."AvailableStock", p0."BrandId", p0."Description", p0."ImageFileName", p0."MaxStockThreshold", p0."Name", p0."OnReorder", p0."Price", p0."RestockThreshold", p0."TypeId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Name", p0."Id") AS row FROM "Products" AS p0 WHERE p0."BrandId" = 1 OR p0."BrandId" = 2 OR p0."BrandId" = 3 - ) AS t1 - WHERE t1.row <= 3 -) AS t0 ON t."BrandId" = t0."BrandId" -ORDER BY t."BrandId", t0."BrandId", t0."Name", t0."Id" + ) AS p2 + WHERE p2.row <= 3 +) AS p3 ON p1."BrandId" = p3."BrandId" +ORDER BY p1."BrandId", p3."BrandId", p3."Name", p3."Id" ``` ## Expression 0 diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_First_5_NET9_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_First_5_NET9_0.md deleted file mode 100644 index 14b1e38fe52..00000000000 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_First_5_NET9_0.md +++ /dev/null @@ -1,153 +0,0 @@ -# BatchPaging_First_5 - -## 1 - -```json -{ - "First": "e31Qcm9kdWN0IDAtMDox", - "Last": "e31Qcm9kdWN0IDAtMToy", - "Items": [ - { - "Id": 1, - "Name": "Product 0-0", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 1, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - }, - { - "Id": 2, - "Name": "Product 0-1", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 1, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - } - ] -} -``` - -## 2 - -```json -{ - "First": "e31Qcm9kdWN0IDEtMDoxMDE=", - "Last": "e31Qcm9kdWN0IDEtMToxMDI=", - "Items": [ - { - "Id": 101, - "Name": "Product 1-0", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 2, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - }, - { - "Id": 102, - "Name": "Product 1-1", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 2, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - } - ] -} -``` - -## 3 - -```json -{ - "First": "e31Qcm9kdWN0IDItMDoyMDE=", - "Last": "e31Qcm9kdWN0IDItMToyMDI=", - "Items": [ - { - "Id": 201, - "Name": "Product 2-0", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 3, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - }, - { - "Id": 202, - "Name": "Product 2-1", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 3, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - } - ] -} -``` - -## SQL 0 - -```sql -SELECT p1."BrandId", p3."Id", p3."AvailableStock", p3."BrandId", p3."Description", p3."ImageFileName", p3."MaxStockThreshold", p3."Name", p3."OnReorder", p3."Price", p3."RestockThreshold", p3."TypeId" -FROM ( - SELECT p."BrandId" - FROM "Products" AS p - WHERE p."BrandId" IN (1, 2, 3) - GROUP BY p."BrandId" -) AS p1 -LEFT JOIN ( - SELECT p2."Id", p2."AvailableStock", p2."BrandId", p2."Description", p2."ImageFileName", p2."MaxStockThreshold", p2."Name", p2."OnReorder", p2."Price", p2."RestockThreshold", p2."TypeId" - FROM ( - SELECT p0."Id", p0."AvailableStock", p0."BrandId", p0."Description", p0."ImageFileName", p0."MaxStockThreshold", p0."Name", p0."OnReorder", p0."Price", p0."RestockThreshold", p0."TypeId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Name", p0."Id") AS row - FROM "Products" AS p0 - WHERE p0."BrandId" = 1 OR p0."BrandId" = 2 OR p0."BrandId" = 3 - ) AS p2 - WHERE p2.row <= 3 -) AS p3 ON p1."BrandId" = p3."BrandId" -ORDER BY p1."BrandId", p3."BrandId", p3."Name", p3."Id" -``` - -## Expression 0 - -```text -[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => (((t.BrandId == 1) OrElse (t.BrandId == 2)) OrElse (t.BrandId == 3))).GroupBy(k => k.BrandId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderBy(p => p.Name).ThenBy(p => p.Id).Take(3).ToList()}) -``` - diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_Last_5.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_Last_5.md index 1ff0e6d16a4..9d8a3d5ea4d 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_Last_5.md +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_Last_5.md @@ -4,12 +4,12 @@ ```json { - "First": "MTAw", - "Last": "OTk=", + "First": "e305OQ==", + "Last": "e30xMDA=", "Items": [ { - "Id": 100, - "Name": "Product 0-99", + "Id": 99, + "Name": "Product 0-98", "Description": null, "Price": 0.0, "ImageFileName": null, @@ -23,8 +23,8 @@ "OnReorder": false }, { - "Id": 99, - "Name": "Product 0-98", + "Id": 100, + "Name": "Product 0-99", "Description": null, "Price": 0.0, "ImageFileName": null, @@ -45,12 +45,12 @@ ```json { - "First": "MjAw", - "Last": "MTk5", + "First": "e30xOTk=", + "Last": "e30yMDA=", "Items": [ { - "Id": 200, - "Name": "Product 1-99", + "Id": 199, + "Name": "Product 1-98", "Description": null, "Price": 0.0, "ImageFileName": null, @@ -64,8 +64,8 @@ "OnReorder": false }, { - "Id": 199, - "Name": "Product 1-98", + "Id": 200, + "Name": "Product 1-99", "Description": null, "Price": 0.0, "ImageFileName": null, @@ -86,12 +86,12 @@ ```json { - "First": "MzAw", - "Last": "Mjk5", + "First": "e30yOTk=", + "Last": "e30zMDA=", "Items": [ { - "Id": 300, - "Name": "Product 2-99", + "Id": 299, + "Name": "Product 2-98", "Description": null, "Price": 0.0, "ImageFileName": null, @@ -105,8 +105,8 @@ "OnReorder": false }, { - "Id": 299, - "Name": "Product 2-98", + "Id": 300, + "Name": "Product 2-99", "Description": null, "Price": 0.0, "ImageFileName": null, @@ -126,23 +126,23 @@ ## SQL 0 ```sql -SELECT t."BrandId", t0."Id", t0."AvailableStock", t0."BrandId", t0."Description", t0."ImageFileName", t0."MaxStockThreshold", t0."Name", t0."OnReorder", t0."Price", t0."RestockThreshold", t0."TypeId" +SELECT p1."BrandId", p3."Id", p3."AvailableStock", p3."BrandId", p3."Description", p3."ImageFileName", p3."MaxStockThreshold", p3."Name", p3."OnReorder", p3."Price", p3."RestockThreshold", p3."TypeId" FROM ( SELECT p."BrandId" FROM "Products" AS p WHERE p."BrandId" IN (1, 2, 3) GROUP BY p."BrandId" -) AS t +) AS p1 LEFT JOIN ( - SELECT t1."Id", t1."AvailableStock", t1."BrandId", t1."Description", t1."ImageFileName", t1."MaxStockThreshold", t1."Name", t1."OnReorder", t1."Price", t1."RestockThreshold", t1."TypeId" + SELECT p2."Id", p2."AvailableStock", p2."BrandId", p2."Description", p2."ImageFileName", p2."MaxStockThreshold", p2."Name", p2."OnReorder", p2."Price", p2."RestockThreshold", p2."TypeId" FROM ( SELECT p0."Id", p0."AvailableStock", p0."BrandId", p0."Description", p0."ImageFileName", p0."MaxStockThreshold", p0."Name", p0."OnReorder", p0."Price", p0."RestockThreshold", p0."TypeId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Id" DESC) AS row FROM "Products" AS p0 WHERE p0."BrandId" = 1 OR p0."BrandId" = 2 OR p0."BrandId" = 3 - ) AS t1 - WHERE t1.row <= 3 -) AS t0 ON t."BrandId" = t0."BrandId" -ORDER BY t."BrandId", t0."BrandId", t0."Id" DESC + ) AS p2 + WHERE p2.row <= 3 +) AS p3 ON p1."BrandId" = p3."BrandId" +ORDER BY p1."BrandId", p3."BrandId", p3."Id" DESC ``` ## Expression 0 diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_Last_5_NET9_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_Last_5_NET9_0.md deleted file mode 100644 index 9d8a3d5ea4d..00000000000 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_Last_5_NET9_0.md +++ /dev/null @@ -1,153 +0,0 @@ -# BatchPaging_Last_5 - -## 1 - -```json -{ - "First": "e305OQ==", - "Last": "e30xMDA=", - "Items": [ - { - "Id": 99, - "Name": "Product 0-98", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 1, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - }, - { - "Id": 100, - "Name": "Product 0-99", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 1, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - } - ] -} -``` - -## 2 - -```json -{ - "First": "e30xOTk=", - "Last": "e30yMDA=", - "Items": [ - { - "Id": 199, - "Name": "Product 1-98", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 2, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - }, - { - "Id": 200, - "Name": "Product 1-99", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 2, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - } - ] -} -``` - -## 3 - -```json -{ - "First": "e30yOTk=", - "Last": "e30zMDA=", - "Items": [ - { - "Id": 299, - "Name": "Product 2-98", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 3, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - }, - { - "Id": 300, - "Name": "Product 2-99", - "Description": null, - "Price": 0.0, - "ImageFileName": null, - "TypeId": 1, - "Type": null, - "BrandId": 3, - "Brand": null, - "AvailableStock": 0, - "RestockThreshold": 0, - "MaxStockThreshold": 0, - "OnReorder": false - } - ] -} -``` - -## SQL 0 - -```sql -SELECT p1."BrandId", p3."Id", p3."AvailableStock", p3."BrandId", p3."Description", p3."ImageFileName", p3."MaxStockThreshold", p3."Name", p3."OnReorder", p3."Price", p3."RestockThreshold", p3."TypeId" -FROM ( - SELECT p."BrandId" - FROM "Products" AS p - WHERE p."BrandId" IN (1, 2, 3) - GROUP BY p."BrandId" -) AS p1 -LEFT JOIN ( - SELECT p2."Id", p2."AvailableStock", p2."BrandId", p2."Description", p2."ImageFileName", p2."MaxStockThreshold", p2."Name", p2."OnReorder", p2."Price", p2."RestockThreshold", p2."TypeId" - FROM ( - SELECT p0."Id", p0."AvailableStock", p0."BrandId", p0."Description", p0."ImageFileName", p0."MaxStockThreshold", p0."Name", p0."OnReorder", p0."Price", p0."RestockThreshold", p0."TypeId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Id" DESC) AS row - FROM "Products" AS p0 - WHERE p0."BrandId" = 1 OR p0."BrandId" = 2 OR p0."BrandId" = 3 - ) AS p2 - WHERE p2.row <= 3 -) AS p3 ON p1."BrandId" = p3."BrandId" -ORDER BY p1."BrandId", p3."BrandId", p3."Id" DESC -``` - -## Expression 0 - -```text -[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => (((t.BrandId == 1) OrElse (t.BrandId == 2)) OrElse (t.BrandId == 3))).GroupBy(k => k.BrandId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderByDescending(p => p.Id).Take(3).ToList()}) -``` - diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_With_Relative_Cursor_NET9_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_With_Relative_Cursor.md similarity index 100% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_With_Relative_Cursor_NET9_0.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.BatchPaging_With_Relative_Cursor.md diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Empty_PagingArgs_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Empty_PagingArgs_NET10_0.md new file mode 100644 index 00000000000..6aca9b3a700 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Empty_PagingArgs_NET10_0.md @@ -0,0 +1,158 @@ +# Paging_Empty_PagingArgs + +## SQL 0 + +```sql +-- @p='11' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": false, + "First": 1, + "FirstCursor": "e31CcmFuZFw6MDox", + "Last": 18, + "LastCursor": "e31CcmFuZFw6MTc6MTg=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 1, + "Name": "Brand:0", + "DisplayName": "BrandDisplay0", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country0" + } + } + }, + { + "Id": 2, + "Name": "Brand:1", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country1" + } + } + }, + { + "Id": 11, + "Name": "Brand:10", + "DisplayName": "BrandDisplay10", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country10" + } + } + }, + { + "Id": 12, + "Name": "Brand:11", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country11" + } + } + }, + { + "Id": 13, + "Name": "Brand:12", + "DisplayName": "BrandDisplay12", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country12" + } + } + }, + { + "Id": 14, + "Name": "Brand:13", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country13" + } + } + }, + { + "Id": 15, + "Name": "Brand:14", + "DisplayName": "BrandDisplay14", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country14" + } + } + }, + { + "Id": 16, + "Name": "Brand:15", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country15" + } + } + }, + { + "Id": 17, + "Name": "Brand:16", + "DisplayName": "BrandDisplay16", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country16" + } + } + }, + { + "Id": 18, + "Name": "Brand:17", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country17" + } + } + } +] +``` + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Empty_PagingArgs.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Empty_PagingArgs_NET9_0.md similarity index 100% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Empty_PagingArgs.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Empty_PagingArgs_NET9_0.md diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_After_Id_13_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_After_Id_13_NET10_0.md new file mode 100644 index 00000000000..0f175695fd2 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_After_Id_13_NET10_0.md @@ -0,0 +1,101 @@ +# Paging_First_5_After_Id_13 + +## SQL 0 + +```sql +-- @value='Brand12' +-- @value1='13' +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value1) +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Where(t => ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) > 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.Int32]).value) > 0)))).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": true, + "First": 14, + "FirstCursor": "e31CcmFuZFw6MTM6MTQ=", + "Last": 18, + "LastCursor": "e31CcmFuZFw6MTc6MTg=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 14, + "Name": "Brand:13", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country13" + } + } + }, + { + "Id": 15, + "Name": "Brand:14", + "DisplayName": "BrandDisplay14", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country14" + } + } + }, + { + "Id": 16, + "Name": "Brand:15", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country15" + } + } + }, + { + "Id": 17, + "Name": "Brand:16", + "DisplayName": "BrandDisplay16", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country16" + } + } + }, + { + "Id": 18, + "Name": "Brand:17", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country17" + } + } + } +] +``` + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_After_Id_13.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_After_Id_13_NET9_0.md similarity index 100% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_After_Id_13.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_After_Id_13_NET9_0.md diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_Before_Id_96_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_Before_Id_96_NET10_0.md new file mode 100644 index 00000000000..53776b7c1c0 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_Before_Id_96_NET10_0.md @@ -0,0 +1,101 @@ +# Paging_First_5_Before_Id_96 + +## SQL 0 + +```sql +-- @value='Brand95' +-- @value1='96' +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderByDescending(t => t.Name).ThenByDescending(t => t.Id).Where(t => ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) < 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.Int32]).value) < 0)))).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": true, + "First": 92, + "FirstCursor": "e31CcmFuZFw6OTE6OTI=", + "Last": 96, + "LastCursor": "e31CcmFuZFw6OTU6OTY=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 92, + "Name": "Brand:91", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country91" + } + } + }, + { + "Id": 93, + "Name": "Brand:92", + "DisplayName": "BrandDisplay92", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country92" + } + } + }, + { + "Id": 94, + "Name": "Brand:93", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country93" + } + } + }, + { + "Id": 95, + "Name": "Brand:94", + "DisplayName": "BrandDisplay94", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country94" + } + } + }, + { + "Id": 96, + "Name": "Brand:95", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country95" + } + } + } +] +``` + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_Before_Id_96.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_Before_Id_96_NET9_0.md similarity index 100% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_Before_Id_96.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_Before_Id_96_NET9_0.md diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_NET10_0.md new file mode 100644 index 00000000000..7f43b5e11c7 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_NET10_0.md @@ -0,0 +1,98 @@ +# Paging_First_5 + +## SQL 0 + +```sql +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": false, + "First": 1, + "FirstCursor": "e31CcmFuZFw6MDox", + "Last": 13, + "LastCursor": "e31CcmFuZFw6MTI6MTM=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 1, + "Name": "Brand:0", + "DisplayName": "BrandDisplay0", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country0" + } + } + }, + { + "Id": 2, + "Name": "Brand:1", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country1" + } + } + }, + { + "Id": 11, + "Name": "Brand:10", + "DisplayName": "BrandDisplay10", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country10" + } + } + }, + { + "Id": 12, + "Name": "Brand:11", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country11" + } + } + }, + { + "Id": 13, + "Name": "Brand:12", + "DisplayName": "BrandDisplay12", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country12" + } + } + } +] +``` + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_NET9_0.md similarity index 100% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_NET9_0.md diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Last_5_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Last_5_NET10_0.md new file mode 100644 index 00000000000..b3fffb7d018 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Last_5_NET10_0.md @@ -0,0 +1,100 @@ +# Paging_Last_5 + +## SQL 0 + +```sql +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderByDescending(t => t.Name).ThenByDescending(t => t.Id).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": false, + "HasPreviousPage": true, + "First": 96, + "FirstName": "Brand:95", + "FirstCursor": "e31CcmFuZFw6OTU6OTY=", + "Last": 100, + "LastName": "Brand:99", + "LastCursor": "e31CcmFuZFw6OTk6MTAw" +} +``` + +## Result 4 + +```json +[ + { + "Id": 96, + "Name": "Brand:95", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country95" + } + } + }, + { + "Id": 97, + "Name": "Brand:96", + "DisplayName": "BrandDisplay96", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country96" + } + } + }, + { + "Id": 98, + "Name": "Brand:97", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country97" + } + } + }, + { + "Id": 99, + "Name": "Brand:98", + "DisplayName": "BrandDisplay98", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country98" + } + } + }, + { + "Id": 100, + "Name": "Brand:99", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country99" + } + } + } +] +``` + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Last_5.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Last_5_NET9_0.md similarity index 100% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Last_5.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Last_5_NET9_0.md diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_WithChildCollectionProjectionExpression_First_5_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_WithChildCollectionProjectionExpression_First_5_NET10_0.md new file mode 100644 index 00000000000..56d4e85ce83 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_WithChildCollectionProjectionExpression_First_5_NET10_0.md @@ -0,0 +1,2073 @@ +# Paging_WithChildCollectionProjectionExpression_First_5 + +## SQL 0 + +```sql +-- @p='6' +SELECT b0."Id", b0."Name", p."Id", p."Name" +FROM ( + SELECT b."Id", b."Name" + FROM "Brands" AS b + ORDER BY b."Name", b."Id" + LIMIT @p +) AS b0 +LEFT JOIN "Products" AS p ON b0."Id" = p."BrandId" +ORDER BY b0."Name", b0."Id" +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Select(brand => new BrandWithProductsDto() {Id = brand.Id, Name = brand.Name, Products = brand.Products.AsQueryable().Select(ProductDto.Projection).ToList()}).OrderBy(t => t.Name).ThenBy(t => t.Id).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": false, + "First": 1, + "FirstCursor": "e31CcmFuZFw6MDox", + "Last": 13, + "LastCursor": "e31CcmFuZFw6MTI6MTM=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 1, + "Name": "Brand:0", + "Products": [ + { + "Id": 1, + "Name": "Product 0-0" + }, + { + "Id": 2, + "Name": "Product 0-1" + }, + { + "Id": 3, + "Name": "Product 0-2" + }, + { + "Id": 4, + "Name": "Product 0-3" + }, + { + "Id": 5, + "Name": "Product 0-4" + }, + { + "Id": 6, + "Name": "Product 0-5" + }, + { + "Id": 7, + "Name": "Product 0-6" + }, + { + "Id": 8, + "Name": "Product 0-7" + }, + { + "Id": 9, + "Name": "Product 0-8" + }, + { + "Id": 10, + "Name": "Product 0-9" + }, + { + "Id": 11, + "Name": "Product 0-10" + }, + { + "Id": 12, + "Name": "Product 0-11" + }, + { + "Id": 13, + "Name": "Product 0-12" + }, + { + "Id": 14, + "Name": "Product 0-13" + }, + { + "Id": 15, + "Name": "Product 0-14" + }, + { + "Id": 16, + "Name": "Product 0-15" + }, + { + "Id": 17, + "Name": "Product 0-16" + }, + { + "Id": 18, + "Name": "Product 0-17" + }, + { + "Id": 19, + "Name": "Product 0-18" + }, + { + "Id": 20, + "Name": "Product 0-19" + }, + { + "Id": 21, + "Name": "Product 0-20" + }, + { + "Id": 22, + "Name": "Product 0-21" + }, + { + "Id": 23, + "Name": "Product 0-22" + }, + { + "Id": 24, + "Name": "Product 0-23" + }, + { + "Id": 25, + "Name": "Product 0-24" + }, + { + "Id": 26, + "Name": "Product 0-25" + }, + { + "Id": 27, + "Name": "Product 0-26" + }, + { + "Id": 28, + "Name": "Product 0-27" + }, + { + "Id": 29, + "Name": "Product 0-28" + }, + { + "Id": 30, + "Name": "Product 0-29" + }, + { + "Id": 31, + "Name": "Product 0-30" + }, + { + "Id": 32, + "Name": "Product 0-31" + }, + { + "Id": 33, + "Name": "Product 0-32" + }, + { + "Id": 34, + "Name": "Product 0-33" + }, + { + "Id": 35, + "Name": "Product 0-34" + }, + { + "Id": 36, + "Name": "Product 0-35" + }, + { + "Id": 37, + "Name": "Product 0-36" + }, + { + "Id": 38, + "Name": "Product 0-37" + }, + { + "Id": 39, + "Name": "Product 0-38" + }, + { + "Id": 40, + "Name": "Product 0-39" + }, + { + "Id": 41, + "Name": "Product 0-40" + }, + { + "Id": 42, + "Name": "Product 0-41" + }, + { + "Id": 43, + "Name": "Product 0-42" + }, + { + "Id": 44, + "Name": "Product 0-43" + }, + { + "Id": 45, + "Name": "Product 0-44" + }, + { + "Id": 46, + "Name": "Product 0-45" + }, + { + "Id": 47, + "Name": "Product 0-46" + }, + { + "Id": 48, + "Name": "Product 0-47" + }, + { + "Id": 49, + "Name": "Product 0-48" + }, + { + "Id": 50, + "Name": "Product 0-49" + }, + { + "Id": 51, + "Name": "Product 0-50" + }, + { + "Id": 52, + "Name": "Product 0-51" + }, + { + "Id": 53, + "Name": "Product 0-52" + }, + { + "Id": 54, + "Name": "Product 0-53" + }, + { + "Id": 55, + "Name": "Product 0-54" + }, + { + "Id": 56, + "Name": "Product 0-55" + }, + { + "Id": 57, + "Name": "Product 0-56" + }, + { + "Id": 58, + "Name": "Product 0-57" + }, + { + "Id": 59, + "Name": "Product 0-58" + }, + { + "Id": 60, + "Name": "Product 0-59" + }, + { + "Id": 61, + "Name": "Product 0-60" + }, + { + "Id": 62, + "Name": "Product 0-61" + }, + { + "Id": 63, + "Name": "Product 0-62" + }, + { + "Id": 64, + "Name": "Product 0-63" + }, + { + "Id": 65, + "Name": "Product 0-64" + }, + { + "Id": 66, + "Name": "Product 0-65" + }, + { + "Id": 67, + "Name": "Product 0-66" + }, + { + "Id": 68, + "Name": "Product 0-67" + }, + { + "Id": 69, + "Name": "Product 0-68" + }, + { + "Id": 70, + "Name": "Product 0-69" + }, + { + "Id": 71, + "Name": "Product 0-70" + }, + { + "Id": 72, + "Name": "Product 0-71" + }, + { + "Id": 73, + "Name": "Product 0-72" + }, + { + "Id": 74, + "Name": "Product 0-73" + }, + { + "Id": 75, + "Name": "Product 0-74" + }, + { + "Id": 76, + "Name": "Product 0-75" + }, + { + "Id": 77, + "Name": "Product 0-76" + }, + { + "Id": 78, + "Name": "Product 0-77" + }, + { + "Id": 79, + "Name": "Product 0-78" + }, + { + "Id": 80, + "Name": "Product 0-79" + }, + { + "Id": 81, + "Name": "Product 0-80" + }, + { + "Id": 82, + "Name": "Product 0-81" + }, + { + "Id": 83, + "Name": "Product 0-82" + }, + { + "Id": 84, + "Name": "Product 0-83" + }, + { + "Id": 85, + "Name": "Product 0-84" + }, + { + "Id": 86, + "Name": "Product 0-85" + }, + { + "Id": 87, + "Name": "Product 0-86" + }, + { + "Id": 88, + "Name": "Product 0-87" + }, + { + "Id": 89, + "Name": "Product 0-88" + }, + { + "Id": 90, + "Name": "Product 0-89" + }, + { + "Id": 91, + "Name": "Product 0-90" + }, + { + "Id": 92, + "Name": "Product 0-91" + }, + { + "Id": 93, + "Name": "Product 0-92" + }, + { + "Id": 94, + "Name": "Product 0-93" + }, + { + "Id": 95, + "Name": "Product 0-94" + }, + { + "Id": 96, + "Name": "Product 0-95" + }, + { + "Id": 97, + "Name": "Product 0-96" + }, + { + "Id": 98, + "Name": "Product 0-97" + }, + { + "Id": 99, + "Name": "Product 0-98" + }, + { + "Id": 100, + "Name": "Product 0-99" + } + ] + }, + { + "Id": 2, + "Name": "Brand:1", + "Products": [ + { + "Id": 101, + "Name": "Product 1-0" + }, + { + "Id": 102, + "Name": "Product 1-1" + }, + { + "Id": 103, + "Name": "Product 1-2" + }, + { + "Id": 104, + "Name": "Product 1-3" + }, + { + "Id": 105, + "Name": "Product 1-4" + }, + { + "Id": 106, + "Name": "Product 1-5" + }, + { + "Id": 107, + "Name": "Product 1-6" + }, + { + "Id": 108, + "Name": "Product 1-7" + }, + { + "Id": 109, + "Name": "Product 1-8" + }, + { + "Id": 110, + "Name": "Product 1-9" + }, + { + "Id": 111, + "Name": "Product 1-10" + }, + { + "Id": 112, + "Name": "Product 1-11" + }, + { + "Id": 113, + "Name": "Product 1-12" + }, + { + "Id": 114, + "Name": "Product 1-13" + }, + { + "Id": 115, + "Name": "Product 1-14" + }, + { + "Id": 116, + "Name": "Product 1-15" + }, + { + "Id": 117, + "Name": "Product 1-16" + }, + { + "Id": 118, + "Name": "Product 1-17" + }, + { + "Id": 119, + "Name": "Product 1-18" + }, + { + "Id": 120, + "Name": "Product 1-19" + }, + { + "Id": 121, + "Name": "Product 1-20" + }, + { + "Id": 122, + "Name": "Product 1-21" + }, + { + "Id": 123, + "Name": "Product 1-22" + }, + { + "Id": 124, + "Name": "Product 1-23" + }, + { + "Id": 125, + "Name": "Product 1-24" + }, + { + "Id": 126, + "Name": "Product 1-25" + }, + { + "Id": 127, + "Name": "Product 1-26" + }, + { + "Id": 128, + "Name": "Product 1-27" + }, + { + "Id": 129, + "Name": "Product 1-28" + }, + { + "Id": 130, + "Name": "Product 1-29" + }, + { + "Id": 131, + "Name": "Product 1-30" + }, + { + "Id": 132, + "Name": "Product 1-31" + }, + { + "Id": 133, + "Name": "Product 1-32" + }, + { + "Id": 134, + "Name": "Product 1-33" + }, + { + "Id": 135, + "Name": "Product 1-34" + }, + { + "Id": 136, + "Name": "Product 1-35" + }, + { + "Id": 137, + "Name": "Product 1-36" + }, + { + "Id": 138, + "Name": "Product 1-37" + }, + { + "Id": 139, + "Name": "Product 1-38" + }, + { + "Id": 140, + "Name": "Product 1-39" + }, + { + "Id": 141, + "Name": "Product 1-40" + }, + { + "Id": 142, + "Name": "Product 1-41" + }, + { + "Id": 143, + "Name": "Product 1-42" + }, + { + "Id": 144, + "Name": "Product 1-43" + }, + { + "Id": 145, + "Name": "Product 1-44" + }, + { + "Id": 146, + "Name": "Product 1-45" + }, + { + "Id": 147, + "Name": "Product 1-46" + }, + { + "Id": 148, + "Name": "Product 1-47" + }, + { + "Id": 149, + "Name": "Product 1-48" + }, + { + "Id": 150, + "Name": "Product 1-49" + }, + { + "Id": 151, + "Name": "Product 1-50" + }, + { + "Id": 152, + "Name": "Product 1-51" + }, + { + "Id": 153, + "Name": "Product 1-52" + }, + { + "Id": 154, + "Name": "Product 1-53" + }, + { + "Id": 155, + "Name": "Product 1-54" + }, + { + "Id": 156, + "Name": "Product 1-55" + }, + { + "Id": 157, + "Name": "Product 1-56" + }, + { + "Id": 158, + "Name": "Product 1-57" + }, + { + "Id": 159, + "Name": "Product 1-58" + }, + { + "Id": 160, + "Name": "Product 1-59" + }, + { + "Id": 161, + "Name": "Product 1-60" + }, + { + "Id": 162, + "Name": "Product 1-61" + }, + { + "Id": 163, + "Name": "Product 1-62" + }, + { + "Id": 164, + "Name": "Product 1-63" + }, + { + "Id": 165, + "Name": "Product 1-64" + }, + { + "Id": 166, + "Name": "Product 1-65" + }, + { + "Id": 167, + "Name": "Product 1-66" + }, + { + "Id": 168, + "Name": "Product 1-67" + }, + { + "Id": 169, + "Name": "Product 1-68" + }, + { + "Id": 170, + "Name": "Product 1-69" + }, + { + "Id": 171, + "Name": "Product 1-70" + }, + { + "Id": 172, + "Name": "Product 1-71" + }, + { + "Id": 173, + "Name": "Product 1-72" + }, + { + "Id": 174, + "Name": "Product 1-73" + }, + { + "Id": 175, + "Name": "Product 1-74" + }, + { + "Id": 176, + "Name": "Product 1-75" + }, + { + "Id": 177, + "Name": "Product 1-76" + }, + { + "Id": 178, + "Name": "Product 1-77" + }, + { + "Id": 179, + "Name": "Product 1-78" + }, + { + "Id": 180, + "Name": "Product 1-79" + }, + { + "Id": 181, + "Name": "Product 1-80" + }, + { + "Id": 182, + "Name": "Product 1-81" + }, + { + "Id": 183, + "Name": "Product 1-82" + }, + { + "Id": 184, + "Name": "Product 1-83" + }, + { + "Id": 185, + "Name": "Product 1-84" + }, + { + "Id": 186, + "Name": "Product 1-85" + }, + { + "Id": 187, + "Name": "Product 1-86" + }, + { + "Id": 188, + "Name": "Product 1-87" + }, + { + "Id": 189, + "Name": "Product 1-88" + }, + { + "Id": 190, + "Name": "Product 1-89" + }, + { + "Id": 191, + "Name": "Product 1-90" + }, + { + "Id": 192, + "Name": "Product 1-91" + }, + { + "Id": 193, + "Name": "Product 1-92" + }, + { + "Id": 194, + "Name": "Product 1-93" + }, + { + "Id": 195, + "Name": "Product 1-94" + }, + { + "Id": 196, + "Name": "Product 1-95" + }, + { + "Id": 197, + "Name": "Product 1-96" + }, + { + "Id": 198, + "Name": "Product 1-97" + }, + { + "Id": 199, + "Name": "Product 1-98" + }, + { + "Id": 200, + "Name": "Product 1-99" + } + ] + }, + { + "Id": 11, + "Name": "Brand:10", + "Products": [ + { + "Id": 1001, + "Name": "Product 10-0" + }, + { + "Id": 1002, + "Name": "Product 10-1" + }, + { + "Id": 1003, + "Name": "Product 10-2" + }, + { + "Id": 1004, + "Name": "Product 10-3" + }, + { + "Id": 1005, + "Name": "Product 10-4" + }, + { + "Id": 1006, + "Name": "Product 10-5" + }, + { + "Id": 1007, + "Name": "Product 10-6" + }, + { + "Id": 1008, + "Name": "Product 10-7" + }, + { + "Id": 1009, + "Name": "Product 10-8" + }, + { + "Id": 1010, + "Name": "Product 10-9" + }, + { + "Id": 1011, + "Name": "Product 10-10" + }, + { + "Id": 1012, + "Name": "Product 10-11" + }, + { + "Id": 1013, + "Name": "Product 10-12" + }, + { + "Id": 1014, + "Name": "Product 10-13" + }, + { + "Id": 1015, + "Name": "Product 10-14" + }, + { + "Id": 1016, + "Name": "Product 10-15" + }, + { + "Id": 1017, + "Name": "Product 10-16" + }, + { + "Id": 1018, + "Name": "Product 10-17" + }, + { + "Id": 1019, + "Name": "Product 10-18" + }, + { + "Id": 1020, + "Name": "Product 10-19" + }, + { + "Id": 1021, + "Name": "Product 10-20" + }, + { + "Id": 1022, + "Name": "Product 10-21" + }, + { + "Id": 1023, + "Name": "Product 10-22" + }, + { + "Id": 1024, + "Name": "Product 10-23" + }, + { + "Id": 1025, + "Name": "Product 10-24" + }, + { + "Id": 1026, + "Name": "Product 10-25" + }, + { + "Id": 1027, + "Name": "Product 10-26" + }, + { + "Id": 1028, + "Name": "Product 10-27" + }, + { + "Id": 1029, + "Name": "Product 10-28" + }, + { + "Id": 1030, + "Name": "Product 10-29" + }, + { + "Id": 1031, + "Name": "Product 10-30" + }, + { + "Id": 1032, + "Name": "Product 10-31" + }, + { + "Id": 1033, + "Name": "Product 10-32" + }, + { + "Id": 1034, + "Name": "Product 10-33" + }, + { + "Id": 1035, + "Name": "Product 10-34" + }, + { + "Id": 1036, + "Name": "Product 10-35" + }, + { + "Id": 1037, + "Name": "Product 10-36" + }, + { + "Id": 1038, + "Name": "Product 10-37" + }, + { + "Id": 1039, + "Name": "Product 10-38" + }, + { + "Id": 1040, + "Name": "Product 10-39" + }, + { + "Id": 1041, + "Name": "Product 10-40" + }, + { + "Id": 1042, + "Name": "Product 10-41" + }, + { + "Id": 1043, + "Name": "Product 10-42" + }, + { + "Id": 1044, + "Name": "Product 10-43" + }, + { + "Id": 1045, + "Name": "Product 10-44" + }, + { + "Id": 1046, + "Name": "Product 10-45" + }, + { + "Id": 1047, + "Name": "Product 10-46" + }, + { + "Id": 1048, + "Name": "Product 10-47" + }, + { + "Id": 1049, + "Name": "Product 10-48" + }, + { + "Id": 1050, + "Name": "Product 10-49" + }, + { + "Id": 1051, + "Name": "Product 10-50" + }, + { + "Id": 1052, + "Name": "Product 10-51" + }, + { + "Id": 1053, + "Name": "Product 10-52" + }, + { + "Id": 1054, + "Name": "Product 10-53" + }, + { + "Id": 1055, + "Name": "Product 10-54" + }, + { + "Id": 1056, + "Name": "Product 10-55" + }, + { + "Id": 1057, + "Name": "Product 10-56" + }, + { + "Id": 1058, + "Name": "Product 10-57" + }, + { + "Id": 1059, + "Name": "Product 10-58" + }, + { + "Id": 1060, + "Name": "Product 10-59" + }, + { + "Id": 1061, + "Name": "Product 10-60" + }, + { + "Id": 1062, + "Name": "Product 10-61" + }, + { + "Id": 1063, + "Name": "Product 10-62" + }, + { + "Id": 1064, + "Name": "Product 10-63" + }, + { + "Id": 1065, + "Name": "Product 10-64" + }, + { + "Id": 1066, + "Name": "Product 10-65" + }, + { + "Id": 1067, + "Name": "Product 10-66" + }, + { + "Id": 1068, + "Name": "Product 10-67" + }, + { + "Id": 1069, + "Name": "Product 10-68" + }, + { + "Id": 1070, + "Name": "Product 10-69" + }, + { + "Id": 1071, + "Name": "Product 10-70" + }, + { + "Id": 1072, + "Name": "Product 10-71" + }, + { + "Id": 1073, + "Name": "Product 10-72" + }, + { + "Id": 1074, + "Name": "Product 10-73" + }, + { + "Id": 1075, + "Name": "Product 10-74" + }, + { + "Id": 1076, + "Name": "Product 10-75" + }, + { + "Id": 1077, + "Name": "Product 10-76" + }, + { + "Id": 1078, + "Name": "Product 10-77" + }, + { + "Id": 1079, + "Name": "Product 10-78" + }, + { + "Id": 1080, + "Name": "Product 10-79" + }, + { + "Id": 1081, + "Name": "Product 10-80" + }, + { + "Id": 1082, + "Name": "Product 10-81" + }, + { + "Id": 1083, + "Name": "Product 10-82" + }, + { + "Id": 1084, + "Name": "Product 10-83" + }, + { + "Id": 1085, + "Name": "Product 10-84" + }, + { + "Id": 1086, + "Name": "Product 10-85" + }, + { + "Id": 1087, + "Name": "Product 10-86" + }, + { + "Id": 1088, + "Name": "Product 10-87" + }, + { + "Id": 1089, + "Name": "Product 10-88" + }, + { + "Id": 1090, + "Name": "Product 10-89" + }, + { + "Id": 1091, + "Name": "Product 10-90" + }, + { + "Id": 1092, + "Name": "Product 10-91" + }, + { + "Id": 1093, + "Name": "Product 10-92" + }, + { + "Id": 1094, + "Name": "Product 10-93" + }, + { + "Id": 1095, + "Name": "Product 10-94" + }, + { + "Id": 1096, + "Name": "Product 10-95" + }, + { + "Id": 1097, + "Name": "Product 10-96" + }, + { + "Id": 1098, + "Name": "Product 10-97" + }, + { + "Id": 1099, + "Name": "Product 10-98" + }, + { + "Id": 1100, + "Name": "Product 10-99" + } + ] + }, + { + "Id": 12, + "Name": "Brand:11", + "Products": [ + { + "Id": 1101, + "Name": "Product 11-0" + }, + { + "Id": 1102, + "Name": "Product 11-1" + }, + { + "Id": 1103, + "Name": "Product 11-2" + }, + { + "Id": 1104, + "Name": "Product 11-3" + }, + { + "Id": 1105, + "Name": "Product 11-4" + }, + { + "Id": 1106, + "Name": "Product 11-5" + }, + { + "Id": 1107, + "Name": "Product 11-6" + }, + { + "Id": 1108, + "Name": "Product 11-7" + }, + { + "Id": 1109, + "Name": "Product 11-8" + }, + { + "Id": 1110, + "Name": "Product 11-9" + }, + { + "Id": 1111, + "Name": "Product 11-10" + }, + { + "Id": 1112, + "Name": "Product 11-11" + }, + { + "Id": 1113, + "Name": "Product 11-12" + }, + { + "Id": 1114, + "Name": "Product 11-13" + }, + { + "Id": 1115, + "Name": "Product 11-14" + }, + { + "Id": 1116, + "Name": "Product 11-15" + }, + { + "Id": 1117, + "Name": "Product 11-16" + }, + { + "Id": 1118, + "Name": "Product 11-17" + }, + { + "Id": 1119, + "Name": "Product 11-18" + }, + { + "Id": 1120, + "Name": "Product 11-19" + }, + { + "Id": 1121, + "Name": "Product 11-20" + }, + { + "Id": 1122, + "Name": "Product 11-21" + }, + { + "Id": 1123, + "Name": "Product 11-22" + }, + { + "Id": 1124, + "Name": "Product 11-23" + }, + { + "Id": 1125, + "Name": "Product 11-24" + }, + { + "Id": 1126, + "Name": "Product 11-25" + }, + { + "Id": 1127, + "Name": "Product 11-26" + }, + { + "Id": 1128, + "Name": "Product 11-27" + }, + { + "Id": 1129, + "Name": "Product 11-28" + }, + { + "Id": 1130, + "Name": "Product 11-29" + }, + { + "Id": 1131, + "Name": "Product 11-30" + }, + { + "Id": 1132, + "Name": "Product 11-31" + }, + { + "Id": 1133, + "Name": "Product 11-32" + }, + { + "Id": 1134, + "Name": "Product 11-33" + }, + { + "Id": 1135, + "Name": "Product 11-34" + }, + { + "Id": 1136, + "Name": "Product 11-35" + }, + { + "Id": 1137, + "Name": "Product 11-36" + }, + { + "Id": 1138, + "Name": "Product 11-37" + }, + { + "Id": 1139, + "Name": "Product 11-38" + }, + { + "Id": 1140, + "Name": "Product 11-39" + }, + { + "Id": 1141, + "Name": "Product 11-40" + }, + { + "Id": 1142, + "Name": "Product 11-41" + }, + { + "Id": 1143, + "Name": "Product 11-42" + }, + { + "Id": 1144, + "Name": "Product 11-43" + }, + { + "Id": 1145, + "Name": "Product 11-44" + }, + { + "Id": 1146, + "Name": "Product 11-45" + }, + { + "Id": 1147, + "Name": "Product 11-46" + }, + { + "Id": 1148, + "Name": "Product 11-47" + }, + { + "Id": 1149, + "Name": "Product 11-48" + }, + { + "Id": 1150, + "Name": "Product 11-49" + }, + { + "Id": 1151, + "Name": "Product 11-50" + }, + { + "Id": 1152, + "Name": "Product 11-51" + }, + { + "Id": 1153, + "Name": "Product 11-52" + }, + { + "Id": 1154, + "Name": "Product 11-53" + }, + { + "Id": 1155, + "Name": "Product 11-54" + }, + { + "Id": 1156, + "Name": "Product 11-55" + }, + { + "Id": 1157, + "Name": "Product 11-56" + }, + { + "Id": 1158, + "Name": "Product 11-57" + }, + { + "Id": 1159, + "Name": "Product 11-58" + }, + { + "Id": 1160, + "Name": "Product 11-59" + }, + { + "Id": 1161, + "Name": "Product 11-60" + }, + { + "Id": 1162, + "Name": "Product 11-61" + }, + { + "Id": 1163, + "Name": "Product 11-62" + }, + { + "Id": 1164, + "Name": "Product 11-63" + }, + { + "Id": 1165, + "Name": "Product 11-64" + }, + { + "Id": 1166, + "Name": "Product 11-65" + }, + { + "Id": 1167, + "Name": "Product 11-66" + }, + { + "Id": 1168, + "Name": "Product 11-67" + }, + { + "Id": 1169, + "Name": "Product 11-68" + }, + { + "Id": 1170, + "Name": "Product 11-69" + }, + { + "Id": 1171, + "Name": "Product 11-70" + }, + { + "Id": 1172, + "Name": "Product 11-71" + }, + { + "Id": 1173, + "Name": "Product 11-72" + }, + { + "Id": 1174, + "Name": "Product 11-73" + }, + { + "Id": 1175, + "Name": "Product 11-74" + }, + { + "Id": 1176, + "Name": "Product 11-75" + }, + { + "Id": 1177, + "Name": "Product 11-76" + }, + { + "Id": 1178, + "Name": "Product 11-77" + }, + { + "Id": 1179, + "Name": "Product 11-78" + }, + { + "Id": 1180, + "Name": "Product 11-79" + }, + { + "Id": 1181, + "Name": "Product 11-80" + }, + { + "Id": 1182, + "Name": "Product 11-81" + }, + { + "Id": 1183, + "Name": "Product 11-82" + }, + { + "Id": 1184, + "Name": "Product 11-83" + }, + { + "Id": 1185, + "Name": "Product 11-84" + }, + { + "Id": 1186, + "Name": "Product 11-85" + }, + { + "Id": 1187, + "Name": "Product 11-86" + }, + { + "Id": 1188, + "Name": "Product 11-87" + }, + { + "Id": 1189, + "Name": "Product 11-88" + }, + { + "Id": 1190, + "Name": "Product 11-89" + }, + { + "Id": 1191, + "Name": "Product 11-90" + }, + { + "Id": 1192, + "Name": "Product 11-91" + }, + { + "Id": 1193, + "Name": "Product 11-92" + }, + { + "Id": 1194, + "Name": "Product 11-93" + }, + { + "Id": 1195, + "Name": "Product 11-94" + }, + { + "Id": 1196, + "Name": "Product 11-95" + }, + { + "Id": 1197, + "Name": "Product 11-96" + }, + { + "Id": 1198, + "Name": "Product 11-97" + }, + { + "Id": 1199, + "Name": "Product 11-98" + }, + { + "Id": 1200, + "Name": "Product 11-99" + } + ] + }, + { + "Id": 13, + "Name": "Brand:12", + "Products": [ + { + "Id": 1201, + "Name": "Product 12-0" + }, + { + "Id": 1202, + "Name": "Product 12-1" + }, + { + "Id": 1203, + "Name": "Product 12-2" + }, + { + "Id": 1204, + "Name": "Product 12-3" + }, + { + "Id": 1205, + "Name": "Product 12-4" + }, + { + "Id": 1206, + "Name": "Product 12-5" + }, + { + "Id": 1207, + "Name": "Product 12-6" + }, + { + "Id": 1208, + "Name": "Product 12-7" + }, + { + "Id": 1209, + "Name": "Product 12-8" + }, + { + "Id": 1210, + "Name": "Product 12-9" + }, + { + "Id": 1211, + "Name": "Product 12-10" + }, + { + "Id": 1212, + "Name": "Product 12-11" + }, + { + "Id": 1213, + "Name": "Product 12-12" + }, + { + "Id": 1214, + "Name": "Product 12-13" + }, + { + "Id": 1215, + "Name": "Product 12-14" + }, + { + "Id": 1216, + "Name": "Product 12-15" + }, + { + "Id": 1217, + "Name": "Product 12-16" + }, + { + "Id": 1218, + "Name": "Product 12-17" + }, + { + "Id": 1219, + "Name": "Product 12-18" + }, + { + "Id": 1220, + "Name": "Product 12-19" + }, + { + "Id": 1221, + "Name": "Product 12-20" + }, + { + "Id": 1222, + "Name": "Product 12-21" + }, + { + "Id": 1223, + "Name": "Product 12-22" + }, + { + "Id": 1224, + "Name": "Product 12-23" + }, + { + "Id": 1225, + "Name": "Product 12-24" + }, + { + "Id": 1226, + "Name": "Product 12-25" + }, + { + "Id": 1227, + "Name": "Product 12-26" + }, + { + "Id": 1228, + "Name": "Product 12-27" + }, + { + "Id": 1229, + "Name": "Product 12-28" + }, + { + "Id": 1230, + "Name": "Product 12-29" + }, + { + "Id": 1231, + "Name": "Product 12-30" + }, + { + "Id": 1232, + "Name": "Product 12-31" + }, + { + "Id": 1233, + "Name": "Product 12-32" + }, + { + "Id": 1234, + "Name": "Product 12-33" + }, + { + "Id": 1235, + "Name": "Product 12-34" + }, + { + "Id": 1236, + "Name": "Product 12-35" + }, + { + "Id": 1237, + "Name": "Product 12-36" + }, + { + "Id": 1238, + "Name": "Product 12-37" + }, + { + "Id": 1239, + "Name": "Product 12-38" + }, + { + "Id": 1240, + "Name": "Product 12-39" + }, + { + "Id": 1241, + "Name": "Product 12-40" + }, + { + "Id": 1242, + "Name": "Product 12-41" + }, + { + "Id": 1243, + "Name": "Product 12-42" + }, + { + "Id": 1244, + "Name": "Product 12-43" + }, + { + "Id": 1245, + "Name": "Product 12-44" + }, + { + "Id": 1246, + "Name": "Product 12-45" + }, + { + "Id": 1247, + "Name": "Product 12-46" + }, + { + "Id": 1248, + "Name": "Product 12-47" + }, + { + "Id": 1249, + "Name": "Product 12-48" + }, + { + "Id": 1250, + "Name": "Product 12-49" + }, + { + "Id": 1251, + "Name": "Product 12-50" + }, + { + "Id": 1252, + "Name": "Product 12-51" + }, + { + "Id": 1253, + "Name": "Product 12-52" + }, + { + "Id": 1254, + "Name": "Product 12-53" + }, + { + "Id": 1255, + "Name": "Product 12-54" + }, + { + "Id": 1256, + "Name": "Product 12-55" + }, + { + "Id": 1257, + "Name": "Product 12-56" + }, + { + "Id": 1258, + "Name": "Product 12-57" + }, + { + "Id": 1259, + "Name": "Product 12-58" + }, + { + "Id": 1260, + "Name": "Product 12-59" + }, + { + "Id": 1261, + "Name": "Product 12-60" + }, + { + "Id": 1262, + "Name": "Product 12-61" + }, + { + "Id": 1263, + "Name": "Product 12-62" + }, + { + "Id": 1264, + "Name": "Product 12-63" + }, + { + "Id": 1265, + "Name": "Product 12-64" + }, + { + "Id": 1266, + "Name": "Product 12-65" + }, + { + "Id": 1267, + "Name": "Product 12-66" + }, + { + "Id": 1268, + "Name": "Product 12-67" + }, + { + "Id": 1269, + "Name": "Product 12-68" + }, + { + "Id": 1270, + "Name": "Product 12-69" + }, + { + "Id": 1271, + "Name": "Product 12-70" + }, + { + "Id": 1272, + "Name": "Product 12-71" + }, + { + "Id": 1273, + "Name": "Product 12-72" + }, + { + "Id": 1274, + "Name": "Product 12-73" + }, + { + "Id": 1275, + "Name": "Product 12-74" + }, + { + "Id": 1276, + "Name": "Product 12-75" + }, + { + "Id": 1277, + "Name": "Product 12-76" + }, + { + "Id": 1278, + "Name": "Product 12-77" + }, + { + "Id": 1279, + "Name": "Product 12-78" + }, + { + "Id": 1280, + "Name": "Product 12-79" + }, + { + "Id": 1281, + "Name": "Product 12-80" + }, + { + "Id": 1282, + "Name": "Product 12-81" + }, + { + "Id": 1283, + "Name": "Product 12-82" + }, + { + "Id": 1284, + "Name": "Product 12-83" + }, + { + "Id": 1285, + "Name": "Product 12-84" + }, + { + "Id": 1286, + "Name": "Product 12-85" + }, + { + "Id": 1287, + "Name": "Product 12-86" + }, + { + "Id": 1288, + "Name": "Product 12-87" + }, + { + "Id": 1289, + "Name": "Product 12-88" + }, + { + "Id": 1290, + "Name": "Product 12-89" + }, + { + "Id": 1291, + "Name": "Product 12-90" + }, + { + "Id": 1292, + "Name": "Product 12-91" + }, + { + "Id": 1293, + "Name": "Product 12-92" + }, + { + "Id": 1294, + "Name": "Product 12-93" + }, + { + "Id": 1295, + "Name": "Product 12-94" + }, + { + "Id": 1296, + "Name": "Product 12-95" + }, + { + "Id": 1297, + "Name": "Product 12-96" + }, + { + "Id": 1298, + "Name": "Product 12-97" + }, + { + "Id": 1299, + "Name": "Product 12-98" + }, + { + "Id": 1300, + "Name": "Product 12-99" + } + ] + } +] +``` + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_WithChildCollectionProjectionExpression_First_5.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_WithChildCollectionProjectionExpression_First_5_NET9_0.md similarity index 100% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_WithChildCollectionProjectionExpression_First_5.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_WithChildCollectionProjectionExpression_First_5_NET9_0.md diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_NET10_0.md new file mode 100644 index 00000000000..41ec78c327e --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_NET10_0.md @@ -0,0 +1,23 @@ +# QueryContext_Simple_Selector_Include_Brand + +## SQL 0 + +```sql +-- @p='3' +SELECT p0."Id", p0."Name", b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM ( + SELECT p."Id", p."BrandId", p."Name" + FROM "Products" AS p + ORDER BY p."Id" + LIMIT @p +) AS p0 +INNER JOIN "Brands" AS b ON p0."BrandId" = b."Id" +ORDER BY p0."Id" +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Id).Select(root => new Product() {Id = root.Id, Name = root.Name, Brand = root.Brand}).Take(3) +``` + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_NET9_0.md similarity index 98% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_NET9_0.md index c04f805eb3a..8bb0bafcb5a 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand.md +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_NET9_0.md @@ -3,15 +3,15 @@ ## SQL 0 ```sql --- @__p_0='3' -SELECT p0."Id", p0."Name", b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" -FROM ( - SELECT p."Id", p."BrandId", p."Name" - FROM "Products" AS p - ORDER BY p."Id" - LIMIT @__p_0 -) AS p0 -INNER JOIN "Brands" AS b ON p0."BrandId" = b."Id" +-- @__p_0='3' +SELECT p0."Id", p0."Name", b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM ( + SELECT p."Id", p."BrandId", p."Name" + FROM "Products" AS p + ORDER BY p."Id" + LIMIT @__p_0 +) AS p0 +INNER JOIN "Brands" AS b ON p0."BrandId" = b."Id" ORDER BY p0."Id" ``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name_NET10_0.md new file mode 100644 index 00000000000..03c104135ea --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name_NET10_0.md @@ -0,0 +1,23 @@ +# QueryContext_Simple_Selector_Include_Brand_Name + +## SQL 0 + +```sql +-- @p='3' +SELECT p0."Id", p0."Name", b."Name" +FROM ( + SELECT p."Id", p."BrandId", p."Name" + FROM "Products" AS p + ORDER BY p."Id" + LIMIT @p +) AS p0 +INNER JOIN "Brands" AS b ON p0."BrandId" = b."Id" +ORDER BY p0."Id" +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Id).Select(root => new Product() {Id = root.Id, Name = root.Name, Brand = new Brand() {Name = root.Brand.Name}}).Take(3) +``` + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name_NET9_0.md similarity index 98% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name_NET9_0.md index 0e99a60eb2c..907ebbf82a1 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name.md +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name_NET9_0.md @@ -3,15 +3,15 @@ ## SQL 0 ```sql --- @__p_0='3' -SELECT p0."Id", p0."Name", b."Name" -FROM ( - SELECT p."Id", p."BrandId", p."Name" - FROM "Products" AS p - ORDER BY p."Id" - LIMIT @__p_0 -) AS p0 -INNER JOIN "Brands" AS b ON p0."BrandId" = b."Id" +-- @__p_0='3' +SELECT p0."Id", p0."Name", b."Name" +FROM ( + SELECT p."Id", p."BrandId", p."Name" + FROM "Products" AS p + ORDER BY p."Id" + LIMIT @__p_0 +) AS p0 +INNER JOIN "Brands" AS b ON p0."BrandId" = b."Id" ORDER BY p0."Id" ``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List_NET10_0.md new file mode 100644 index 00000000000..29698430833 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List_NET10_0.md @@ -0,0 +1,23 @@ +# QueryContext_Simple_Selector_Include_Product_List + +## SQL 0 + +```sql +-- @p='3' +SELECT b0."Id", b0."Name", p."Id", p."Name" +FROM ( + SELECT b."Id", b."Name" + FROM "Brands" AS b + ORDER BY b."Id" + LIMIT @p +) AS b0 +LEFT JOIN "Products" AS p ON b0."Id" = p."BrandId" +ORDER BY b0."Id" +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Id).Select(root => new Brand() {Id = root.Id, Name = root.Name, Products = root.Products.Select(p => new Product() {Id = p.Id, Name = p.Name}).ToList()}).Take(3) +``` + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List_NET9_0.md similarity index 98% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List_NET9_0.md index cbce9835c8b..d3894f10c93 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List.md +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List_NET9_0.md @@ -3,15 +3,15 @@ ## SQL 0 ```sql --- @__p_0='3' -SELECT b0."Id", b0."Name", p."Id", p."Name" -FROM ( - SELECT b."Id", b."Name" - FROM "Brands" AS b - ORDER BY b."Id" - LIMIT @__p_0 -) AS b0 -LEFT JOIN "Products" AS p ON b0."Id" = p."BrandId" +-- @__p_0='3' +SELECT b0."Id", b0."Name", p."Id", p."Name" +FROM ( + SELECT b."Id", b."Name" + FROM "Brands" AS b + ORDER BY b."Id" + LIMIT @__p_0 +) AS b0 +LEFT JOIN "Products" AS p ON b0."Id" = p."BrandId" ORDER BY b0."Id" ``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_NET10_0.md new file mode 100644 index 00000000000..6ebb1573a9b --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_NET10_0.md @@ -0,0 +1,18 @@ +# QueryContext_Simple_Selector + +## SQL 0 + +```sql +-- @p='3' +SELECT p."Id", p."Name" +FROM "Products" AS p +ORDER BY p."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Id).Select(t => new Product() {Id = t.Id, Name = t.Name}).Take(3) +``` + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_NET9_0.md similarity index 98% rename from src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_NET9_0.md index 6ecf4d83fa2..d9934bb18dc 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector.md +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_NET9_0.md @@ -3,10 +3,10 @@ ## SQL 0 ```sql --- @__p_0='3' -SELECT p."Id", p."Name" -FROM "Products" AS p -ORDER BY p."Id" +-- @__p_0='3' +SELECT p."Id", p."Name" +FROM "Products" AS p +ORDER BY p."Id" LIMIT @__p_0 ``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_1_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_1_NET10_0.snap new file mode 100644 index 00000000000..97f4d7ad96b --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_1_NET10_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Dynamova' +-- @value1='4' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @value OR (b0."Name" = @value AND b0."Id" > @value1)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_1_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_1_NET9_0.snap new file mode 100644 index 00000000000..ff4dd0cb358 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_1_NET9_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Dynamova' +-- @__value_1='4' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" > @__value_1)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_2_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_2_NET10_0.snap new file mode 100644 index 00000000000..2f40829fe3c --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_2_NET10_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value1='2' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @value OR (b0."Name" = @value AND b0."Id" > @value1)) + ) AS b2 + WHERE 4 < b2.row AND b2.row <= 7 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_2_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_2_NET9_0.snap new file mode 100644 index 00000000000..94f20909507 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_2_NET9_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Brightex' +-- @__value_1='2' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" > @__value_1)) + ) AS b2 + WHERE 4 < b2.row AND b2.row <= 7 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET10_0.snap new file mode 100644 index 00000000000..8cc83fbf735 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET10_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Quantumis' +-- @value1='17' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @value OR (b0."Name" = @value AND b0."Id" < @value1)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET9_0.snap new file mode 100644 index 00000000000..e30f6fc3a52 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET9_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Quantumis' +-- @__value_1='17' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" < @__value_1)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_Offset_Negative_2_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_Offset_Negative_2_NET10_0.snap new file mode 100644 index 00000000000..d04b41d8b24 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_Offset_Negative_2_NET10_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value1='19' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @value OR (b0."Name" = @value AND b0."Id" < @value1)) + ) AS b2 + WHERE 4 < b2.row AND b2.row <= 7 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_Offset_Negative_2_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_Offset_Negative_2_NET9_0.snap new file mode 100644 index 00000000000..d10627e08cb --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_Offset_Negative_2_NET9_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Synerflux' +-- @__value_1='19' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" < @__value_1)) + ) AS b2 + WHERE 4 < b2.row AND b2.row <= 7 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_Page_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_Page_NET10_0.snap new file mode 100644 index 00000000000..513a9f754b4 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_Page_NET10_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 2, + "TotalCount": 20, + "Items": [ + "Celestara", + "Dynamova" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value1='2' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @value OR (b0."Name" = @value AND b0."Id" > @value1)) + ) AS b2 + WHERE b2.row <= 3 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_Page_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_Page_NET9_0.snap new file mode 100644 index 00000000000..aa48046f111 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_Page_NET9_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 2, + "TotalCount": 20, + "Items": [ + "Celestara", + "Dynamova" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Brightex' +-- @__value_1='2' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" > @__value_1)) + ) AS b2 + WHERE b2.row <= 3 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_To_Last_Page_Offset_0_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_To_Last_Page_Offset_0_NET10_0.snap new file mode 100644 index 00000000000..84e434c9f0d --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_To_Last_Page_Offset_0_NET10_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 9, + "TotalCount": 20, + "Items": [ + "Quantumis", + "Radiantum" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value1='19' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @value OR (b0."Name" = @value AND b0."Id" < @value1)) + ) AS b2 + WHERE b2.row <= 3 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_To_Last_Page_Offset_0_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_To_Last_Page_Offset_0_NET9_0.snap new file mode 100644 index 00000000000..0f4b835dc66 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_To_Last_Page_Offset_0_NET9_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 9, + "TotalCount": 20, + "Items": [ + "Quantumis", + "Radiantum" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Synerflux' +-- @__value_1='19' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" < @__value_1)) + ) AS b2 + WHERE b2.row <= 3 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_Page_With_Offset_1_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_Page_With_Offset_1_NET10_0.snap new file mode 100644 index 00000000000..902099ca0e8 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_Page_With_Offset_1_NET10_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 3, + "TotalCount": 20, + "Items": [ + "Evolvance", + "Futurova" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value1='2' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @value OR (b0."Name" = @value AND b0."Id" > @value1)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_Page_With_Offset_1_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_Page_With_Offset_1_NET9_0.snap new file mode 100644 index 00000000000..b1972e6fb8f --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_Page_With_Offset_1_NET9_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 3, + "TotalCount": 20, + "Items": [ + "Evolvance", + "Futurova" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Brightex' +-- @__value_1='2' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" > @__value_1)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_To_Last_Page_Offset_Negative_1_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_To_Last_Page_Offset_Negative_1_NET10_0.snap new file mode 100644 index 00000000000..9199b903064 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_To_Last_Page_Offset_Negative_1_NET10_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 8, + "TotalCount": 20, + "Items": [ + "Omniflex", + "Pulsarix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value1='19' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @value OR (b0."Name" = @value AND b0."Id" < @value1)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_To_Last_Page_Offset_Negative_1_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_To_Last_Page_Offset_Negative_1_NET9_0.snap new file mode 100644 index 00000000000..0b69cc12f71 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_To_Last_Page_Offset_Negative_1_NET9_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 8, + "TotalCount": 20, + "Items": [ + "Omniflex", + "Pulsarix" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Synerflux' +-- @__value_1='19' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @__value_0 OR (b0."Name" = @__value_0 AND b0."Id" < @__value_1)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_1_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_1_NET10_0.snap new file mode 100644 index 00000000000..da5e407e6ea --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_1_NET10_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Dynamova' +-- @value1='4' +-- @p0='3' +-- @p='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value1) +ORDER BY b."Name", b."Id" +LIMIT @p0 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_1_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_1_NET9_0.snap new file mode 100644 index 00000000000..c13fb298e32 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_1_NET9_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Dynamova' +-- @__value_1='4' +-- @__p_3='3' +-- @__p_2='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) +ORDER BY b."Name", b."Id" +LIMIT @__p_3 OFFSET @__p_2 +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_2_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_2_NET10_0.snap new file mode 100644 index 00000000000..53b4584fbb8 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_2_NET10_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value1='2' +-- @p0='3' +-- @p='4' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value1) +ORDER BY b."Name", b."Id" +LIMIT @p0 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_2_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_2_NET9_0.snap new file mode 100644 index 00000000000..c3c55618501 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_2_NET9_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Brightex' +-- @__value_1='2' +-- @__p_3='3' +-- @__p_2='4' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) +ORDER BY b."Name", b."Id" +LIMIT @__p_3 OFFSET @__p_2 +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET10_0.snap new file mode 100644 index 00000000000..5687fef7a8a --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET10_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Quantumis' +-- @value1='17' +-- @p0='3' +-- @p='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p0 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET9_0.snap new file mode 100644 index 00000000000..b7b3bbb7d6a --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET9_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Quantumis' +-- @__value_1='17' +-- @__p_3='3' +-- @__p_2='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @__value_0 OR (b."Name" = @__value_0 AND b."Id" < @__value_1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @__p_3 OFFSET @__p_2 +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_Offset_Negative_2_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_Offset_Negative_2_NET10_0.snap new file mode 100644 index 00000000000..ef4e006ddb6 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_Offset_Negative_2_NET10_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value1='19' +-- @p0='3' +-- @p='4' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p0 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_Offset_Negative_2_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_Offset_Negative_2_NET9_0.snap new file mode 100644 index 00000000000..1a9fcf9dcf2 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_Offset_Negative_2_NET9_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Synerflux' +-- @__value_1='19' +-- @__p_3='3' +-- @__p_2='4' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @__value_0 OR (b."Name" = @__value_0 AND b."Id" < @__value_1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @__p_3 OFFSET @__p_2 +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_Page_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_Page_NET10_0.snap new file mode 100644 index 00000000000..dc5df4a19ad --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_Page_NET10_0.snap @@ -0,0 +1,22 @@ +--------------- +{ + "Page": 2, + "TotalCount": 20, + "Items": [ + "Celestara", + "Dynamova" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value1='2' +-- @p='3' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value1) +ORDER BY b."Name", b."Id" +LIMIT @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_Page_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_Page_NET9_0.snap new file mode 100644 index 00000000000..4ffe8fd6831 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_Page_NET9_0.snap @@ -0,0 +1,22 @@ +--------------- +{ + "Page": 2, + "TotalCount": 20, + "Items": [ + "Celestara", + "Dynamova" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Brightex' +-- @__value_1='2' +-- @__p_2='3' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) +ORDER BY b."Name", b."Id" +LIMIT @__p_2 +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_To_Last_Page_Offset_0_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_To_Last_Page_Offset_0_NET10_0.snap new file mode 100644 index 00000000000..8d94c41724c --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_To_Last_Page_Offset_0_NET10_0.snap @@ -0,0 +1,22 @@ +--------------- +{ + "Page": 9, + "TotalCount": 20, + "Items": [ + "Quantumis", + "Radiantum" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value1='19' +-- @p='3' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_To_Last_Page_Offset_0_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_To_Last_Page_Offset_0_NET9_0.snap new file mode 100644 index 00000000000..af8919f18ac --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_To_Last_Page_Offset_0_NET9_0.snap @@ -0,0 +1,22 @@ +--------------- +{ + "Page": 9, + "TotalCount": 20, + "Items": [ + "Quantumis", + "Radiantum" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Synerflux' +-- @__value_1='19' +-- @__p_2='3' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @__value_0 OR (b."Name" = @__value_0 AND b."Id" < @__value_1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @__p_2 +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_Page_With_Offset_1_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_Page_With_Offset_1_NET10_0.snap new file mode 100644 index 00000000000..32148d89a7f --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_Page_With_Offset_1_NET10_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 3, + "TotalCount": 20, + "Items": [ + "Evolvance", + "Futurova" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value1='2' +-- @p0='3' +-- @p='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value1) +ORDER BY b."Name", b."Id" +LIMIT @p0 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_Page_With_Offset_1_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_Page_With_Offset_1_NET9_0.snap new file mode 100644 index 00000000000..0bc6404bf86 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_Page_With_Offset_1_NET9_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 3, + "TotalCount": 20, + "Items": [ + "Evolvance", + "Futurova" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Brightex' +-- @__value_1='2' +-- @__p_3='3' +-- @__p_2='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) +ORDER BY b."Name", b."Id" +LIMIT @__p_3 OFFSET @__p_2 +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_To_Last_Page_Offset_Negative_1_NET10_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_To_Last_Page_Offset_Negative_1_NET10_0.snap new file mode 100644 index 00000000000..d50f11a0399 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_To_Last_Page_Offset_Negative_1_NET10_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 8, + "TotalCount": 20, + "Items": [ + "Omniflex", + "Pulsarix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value1='19' +-- @p0='3' +-- @p='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p0 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_To_Last_Page_Offset_Negative_1_NET9_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_To_Last_Page_Offset_Negative_1_NET9_0.snap new file mode 100644 index 00000000000..6634ba60924 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_To_Last_Page_Offset_Negative_1_NET9_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 8, + "TotalCount": 20, + "Items": [ + "Omniflex", + "Pulsarix" + ] +} +--------------- + +SQL 0 +--------------- +-- @__value_0='Synerflux' +-- @__value_1='19' +-- @__p_3='3' +-- @__p_2='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @__value_0 OR (b."Name" = @__value_0 AND b."Id" < @__value_1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @__p_3 OFFSET @__p_2 +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.Tests/GreenDonut.Data.Tests.csproj b/src/GreenDonut/test/GreenDonut.Data.Tests/GreenDonut.Data.Tests.csproj index 7b37a3fa7b2..940ecd4f5f9 100644 --- a/src/GreenDonut/test/GreenDonut.Data.Tests/GreenDonut.Data.Tests.csproj +++ b/src/GreenDonut/test/GreenDonut.Data.Tests/GreenDonut.Data.Tests.csproj @@ -11,7 +11,6 @@ - diff --git a/src/GreenDonut/test/GreenDonut.Tests/GreenDonut.Tests.csproj b/src/GreenDonut/test/GreenDonut.Tests/GreenDonut.Tests.csproj index eb653d0e86e..cb544ba24a1 100644 --- a/src/GreenDonut/test/GreenDonut.Tests/GreenDonut.Tests.csproj +++ b/src/GreenDonut/test/GreenDonut.Tests/GreenDonut.Tests.csproj @@ -12,7 +12,6 @@ - diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/HotChocolate.ApolloFederation.Tests.csproj b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/HotChocolate.ApolloFederation.Tests.csproj index 1e7441ca607..f83c662caee 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/HotChocolate.ApolloFederation.Tests.csproj +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/HotChocolate.ApolloFederation.Tests.csproj @@ -10,8 +10,4 @@ - - - - diff --git a/src/HotChocolate/AspNetCore/src/Transport.Http/HotChocolate.Transport.Http.csproj b/src/HotChocolate/AspNetCore/src/Transport.Http/HotChocolate.Transport.Http.csproj index d65e1ac47b3..2a9d9185eb7 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Http/HotChocolate.Transport.Http.csproj +++ b/src/HotChocolate/AspNetCore/src/Transport.Http/HotChocolate.Transport.Http.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/HotChocolate/AspNetCore/src/Transport.Sockets/HotChocolate.Transport.Sockets.csproj b/src/HotChocolate/AspNetCore/src/Transport.Sockets/HotChocolate.Transport.Sockets.csproj index dc8a5f89094..80ca1928fc9 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Sockets/HotChocolate.Transport.Sockets.csproj +++ b/src/HotChocolate/AspNetCore/src/Transport.Sockets/HotChocolate.Transport.Sockets.csproj @@ -7,7 +7,7 @@ This package contains common abstractions and base classes for socket transport. - + diff --git a/src/HotChocolate/AzureFunctions/src/HotChocolate.AzureFunctions/HotChocolate.AzureFunctions.csproj b/src/HotChocolate/AzureFunctions/src/HotChocolate.AzureFunctions/HotChocolate.AzureFunctions.csproj index 082a352bfa7..b02bcc7e998 100644 --- a/src/HotChocolate/AzureFunctions/src/HotChocolate.AzureFunctions/HotChocolate.AzureFunctions.csproj +++ b/src/HotChocolate/AzureFunctions/src/HotChocolate.AzureFunctions/HotChocolate.AzureFunctions.csproj @@ -20,6 +20,8 @@ + + diff --git a/src/HotChocolate/Core/src/Execution/HotChocolate.Execution.csproj b/src/HotChocolate/Core/src/Execution/HotChocolate.Execution.csproj index dbda583fc09..df3bb55eb9a 100644 --- a/src/HotChocolate/Core/src/Execution/HotChocolate.Execution.csproj +++ b/src/HotChocolate/Core/src/Execution/HotChocolate.Execution.csproj @@ -41,6 +41,9 @@ + + + diff --git a/src/HotChocolate/Core/test/Execution.Tests/HotChocolate.Execution.Tests.csproj b/src/HotChocolate/Core/test/Execution.Tests/HotChocolate.Execution.Tests.csproj index dcdde56cd1d..17b7c9c5d0d 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/HotChocolate.Execution.Tests.csproj +++ b/src/HotChocolate/Core/test/Execution.Tests/HotChocolate.Execution.Tests.csproj @@ -18,7 +18,6 @@ - diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/HotChocolate.Types.Analyzers.Integration.Tests.csproj b/src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/HotChocolate.Types.Analyzers.Integration.Tests.csproj index 2a1e3e97f9c..d6075ae9495 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/HotChocolate.Types.Analyzers.Integration.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/HotChocolate.Types.Analyzers.Integration.Tests.csproj @@ -29,6 +29,7 @@ + diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj b/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj index a1d487bfd2e..bca813e14b4 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj @@ -29,6 +29,7 @@ + diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs b/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs index 0dd1cd0d3a9..a9e43c8169b 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs +++ b/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs @@ -36,6 +36,8 @@ public static Snapshot GetGeneratedSourceSnapshot(string[] sourceTexts, string? .. Net80.References.All, #elif NET9_0 .. Net90.References.All, +#elif NET10_0 + .. Net100.References.All, #endif // HotChocolate.Execution MetadataReference.CreateFromFile(typeof(RequestDelegate).Assembly.Location), diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/HotChocolate.Types.CursorPagination.Tests.csproj b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/HotChocolate.Types.CursorPagination.Tests.csproj index 4eb72ad71a1..43184e6607e 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/HotChocolate.Types.CursorPagination.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/HotChocolate.Types.CursorPagination.Tests.csproj @@ -5,10 +5,6 @@ $(NoWarn);CS8632 - - - - diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/HotChocolate.Types.NodaTime.Tests.csproj b/src/HotChocolate/Core/test/Types.NodaTime.Tests/HotChocolate.Types.NodaTime.Tests.csproj index 701f6be04af..d7cdb3cafe4 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/HotChocolate.Types.NodaTime.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/HotChocolate.Types.NodaTime.Tests.csproj @@ -5,10 +5,6 @@ HotChocolate.Types.NodaTime - - - - diff --git a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/HotChocolate.Types.OffsetPagination.Tests.csproj b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/HotChocolate.Types.OffsetPagination.Tests.csproj index 9168efc130e..093cfb9856e 100644 --- a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/HotChocolate.Types.OffsetPagination.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/HotChocolate.Types.OffsetPagination.Tests.csproj @@ -5,10 +5,6 @@ HotChocolate - - - - diff --git a/src/HotChocolate/Core/test/Types.Records.Tests/HotChocolate.Types.Records.Tests.csproj b/src/HotChocolate/Core/test/Types.Records.Tests/HotChocolate.Types.Records.Tests.csproj index ba64b5ab786..e20b442a37b 100644 --- a/src/HotChocolate/Core/test/Types.Records.Tests/HotChocolate.Types.Records.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.Records.Tests/HotChocolate.Types.Records.Tests.csproj @@ -1,9 +1,5 @@ - - - - HotChocolate.Types.Tests HotChocolate diff --git a/src/HotChocolate/Core/test/Types.Scalars.Tests/HotChocolate.Types.Scalars.Tests.csproj b/src/HotChocolate/Core/test/Types.Scalars.Tests/HotChocolate.Types.Scalars.Tests.csproj index ffc4d51ebb2..b314284c42c 100644 --- a/src/HotChocolate/Core/test/Types.Scalars.Tests/HotChocolate.Types.Scalars.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.Scalars.Tests/HotChocolate.Types.Scalars.Tests.csproj @@ -5,10 +5,6 @@ HotChocolate.Types - - - - diff --git a/src/HotChocolate/Core/test/Types.Tests/HotChocolate.Types.Tests.csproj b/src/HotChocolate/Core/test/Types.Tests/HotChocolate.Types.Tests.csproj index d64c10bb944..fe1ac639264 100644 --- a/src/HotChocolate/Core/test/Types.Tests/HotChocolate.Types.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.Tests/HotChocolate.Types.Tests.csproj @@ -8,7 +8,6 @@ - diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs index 14625e208d4..6eb873bfca2 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs @@ -48,7 +48,10 @@ public async Task Paging_With_Default_Sorting() """) .SetGlobalState("printSQL", true)); - result.MatchMarkdownSnapshot(); + result.MatchMarkdownSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } [Fact] @@ -81,7 +84,10 @@ public async Task Paging_Next_2_With_Default_Sorting() """) .SetGlobalState("printSQL", true)); - result.MatchMarkdownSnapshot(); + result.MatchMarkdownSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } [Fact] @@ -115,7 +121,10 @@ public async Task Paging_With_Default_Sorting_And_TotalCount() """) .SetGlobalState("printSQL", true)); - result.MatchMarkdownSnapshot(); + result.MatchMarkdownSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } [Fact] @@ -172,7 +181,10 @@ public async Task Paging_With_PagingFlags_Override() """) .SetGlobalState("printSQL", true)); - result.MatchMarkdownSnapshot(); + result.MatchMarkdownSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } [Fact] @@ -205,7 +217,10 @@ public async Task Paging_With_User_Sorting() """) .SetGlobalState("printSQL", true)); - result.MatchMarkdownSnapshot(); + result.MatchMarkdownSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } [Fact] @@ -238,7 +253,10 @@ public async Task Paging_Next_2_With_User_Sorting() """) .SetGlobalState("printSQL", true)); - result.MatchMarkdownSnapshot(); + result.MatchMarkdownSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } [Fact] @@ -273,7 +291,10 @@ public async Task Paging_First_10_With_Default_Sorting_HasNextPage() """) .SetGlobalState("printSQL", true)); - result.MatchMarkdownSnapshot(); + result.MatchMarkdownSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } [Fact] @@ -308,7 +329,10 @@ public async Task Paging_Last_10_With_Default_Sorting_HasPreviousPage() """) .SetGlobalState("printSQL", true)); - result.MatchMarkdownSnapshot(); + result.MatchMarkdownSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } [Fact] @@ -344,7 +368,10 @@ public async Task Paging_Fetch_First_2_Items_Between() """) .SetGlobalState("printSQL", true)); - result.MatchMarkdownSnapshot(); + result.MatchMarkdownSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } [Fact] @@ -380,7 +407,10 @@ public async Task Paging_Fetch_Last_2_Items_Between() """) .SetGlobalState("printSQL", true)); - result.MatchMarkdownSnapshot(); + result.MatchMarkdownSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } public class Query diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between_NET10_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between_NET10_0.md new file mode 100644 index 00000000000..0348700c648 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between_NET10_0.md @@ -0,0 +1,27 @@ +# Paging_Fetch_First_2_Items_Between + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand1" + }, + { + "name": "Brand2" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "endCursor": "e30z", + "startCursor": "e30y" + } + } + }, + "extensions": { + "sql": "-- @value='1'\n-- @value0='4'\n-- @p='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @value AND b.\"Id\" < @value0\nORDER BY b.\"Id\"\nLIMIT @p" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between_NET10_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between_NET10_0.md new file mode 100644 index 00000000000..95119e801a5 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between_NET10_0.md @@ -0,0 +1,27 @@ +# Paging_Fetch_Last_2_Items_Between + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand97" + }, + { + "name": "Brand98" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "endCursor": "e305OQ==", + "startCursor": "e305OA==" + } + } + }, + "extensions": { + "sql": "-- @value='97'\n-- @value0='100'\n-- @p='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @value AND b.\"Id\" < @value0\nORDER BY b.\"Id\" DESC\nLIMIT @p" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_First_10_With_Default_Sorting_HasNextPage_NET10_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_First_10_With_Default_Sorting_HasNextPage_NET10_0.md new file mode 100644 index 00000000000..af8dd68846d --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_First_10_With_Default_Sorting_HasNextPage_NET10_0.md @@ -0,0 +1,50 @@ +# Paging_First_10_With_Default_Sorting_HasNextPage + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand0" + }, + { + "name": "Brand1" + }, + { + "name": "Brand2" + }, + { + "name": "Brand3" + }, + { + "name": "Brand4" + }, + { + "name": "Brand5" + }, + { + "name": "Brand6" + }, + { + "name": "Brand7" + }, + { + "name": "Brand8" + }, + { + "name": "Brand9" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "endCursor": "e30xMA==" + } + } + }, + "extensions": { + "sql": "-- @p='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\"\nLIMIT @p" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Last_10_With_Default_Sorting_HasPreviousPage_NET10_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Last_10_With_Default_Sorting_HasPreviousPage_NET10_0.md new file mode 100644 index 00000000000..15f74feade0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Last_10_With_Default_Sorting_HasPreviousPage_NET10_0.md @@ -0,0 +1,50 @@ +# Paging_Last_10_With_Default_Sorting_HasPreviousPage + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand90" + }, + { + "name": "Brand91" + }, + { + "name": "Brand92" + }, + { + "name": "Brand93" + }, + { + "name": "Brand94" + }, + { + "name": "Brand95" + }, + { + "name": "Brand96" + }, + { + "name": "Brand97" + }, + { + "name": "Brand98" + }, + { + "name": "Brand99" + } + ], + "pageInfo": { + "hasNextPage": false, + "hasPreviousPage": true, + "endCursor": "e30xMDA=" + } + } + }, + "extensions": { + "sql": "-- @p='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\" DESC\nLIMIT @p" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_Default_Sorting_NET10_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_Default_Sorting_NET10_0.md new file mode 100644 index 00000000000..ea8f74a303d --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_Default_Sorting_NET10_0.md @@ -0,0 +1,24 @@ +# Paging_Next_2_With_Default_Sorting + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand10" + }, + { + "name": "Brand11" + } + ], + "pageInfo": { + "endCursor": "e30xMg==" + } + } + }, + "extensions": { + "sql": "-- @value='10'\n-- @p='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @value\nORDER BY b.\"Id\"\nLIMIT @p" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting_NET10_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting_NET10_0.md new file mode 100644 index 00000000000..dbb98ba68f7 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting_NET10_0.md @@ -0,0 +1,24 @@ +# Paging_Next_2_With_User_Sorting + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand18" + }, + { + "name": "Brand19" + } + ], + "pageInfo": { + "endCursor": "e31CcmFuZDE5OjIw" + } + } + }, + "extensions": { + "sql": "-- @value='Brand17'\n-- @value1='18'\n-- @p='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Name\" > @value OR (b.\"Name\" = @value AND b.\"Id\" > @value1)\nORDER BY b.\"Name\", b.\"Id\"\nLIMIT @p" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_And_TotalCount_NET10_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_And_TotalCount_NET10_0.md new file mode 100644 index 00000000000..e140bd8f6fa --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_And_TotalCount_NET10_0.md @@ -0,0 +1,49 @@ +# Paging_With_Default_Sorting_And_TotalCount + +```json +{ + "data": { + "products": { + "nodes": [ + { + "name": "Product 0-0" + }, + { + "name": "Product 0-1" + }, + { + "name": "Product 0-2" + }, + { + "name": "Product 0-3" + }, + { + "name": "Product 0-4" + }, + { + "name": "Product 0-5" + }, + { + "name": "Product 0-6" + }, + { + "name": "Product 0-7" + }, + { + "name": "Product 0-8" + }, + { + "name": "Product 0-9" + } + ], + "pageInfo": { + "endCursor": "e30xMA==" + }, + "totalCount": 10000 + } + }, + "extensions": { + "sql": "-- @p='11'\nSELECT p.\"Id\", p.\"AvailableStock\", p.\"BrandId\", p.\"Description\", p.\"ImageFileName\", p.\"MaxStockThreshold\", p.\"Name\", p.\"OnReorder\", p.\"Price\", p.\"RestockThreshold\", p.\"TypeId\"\nFROM \"Products\" AS p\nORDER BY p.\"Id\"\nLIMIT @p" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_NET10_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_NET10_0.md new file mode 100644 index 00000000000..fa053263b73 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_NET10_0.md @@ -0,0 +1,48 @@ +# Paging_With_Default_Sorting + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand0" + }, + { + "name": "Brand1" + }, + { + "name": "Brand2" + }, + { + "name": "Brand3" + }, + { + "name": "Brand4" + }, + { + "name": "Brand5" + }, + { + "name": "Brand6" + }, + { + "name": "Brand7" + }, + { + "name": "Brand8" + }, + { + "name": "Brand9" + } + ], + "pageInfo": { + "endCursor": "e30xMA==" + } + } + }, + "extensions": { + "sql": "-- @p='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\"\nLIMIT @p" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_PagingFlags_Override_NET10_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_PagingFlags_Override_NET10_0.md new file mode 100644 index 00000000000..088e49b2ede --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_PagingFlags_Override_NET10_0.md @@ -0,0 +1,14 @@ +# Paging_With_PagingFlags_Override + +```json +{ + "data": { + "products": { + "pageCount": 10 + } + }, + "extensions": { + "sql": "-- @p='11'\nSELECT p.\"Id\", p.\"AvailableStock\", p.\"BrandId\", p.\"Description\", p.\"ImageFileName\", p.\"MaxStockThreshold\", p.\"Name\", p.\"OnReorder\", p.\"Price\", p.\"RestockThreshold\", p.\"TypeId\"\nFROM \"Products\" AS p\nORDER BY p.\"Id\"\nLIMIT @p" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_User_Sorting_NET10_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_User_Sorting_NET10_0.md new file mode 100644 index 00000000000..8c6bdd75620 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_User_Sorting_NET10_0.md @@ -0,0 +1,48 @@ +# Paging_With_User_Sorting + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand0" + }, + { + "name": "Brand1" + }, + { + "name": "Brand10" + }, + { + "name": "Brand11" + }, + { + "name": "Brand12" + }, + { + "name": "Brand13" + }, + { + "name": "Brand14" + }, + { + "name": "Brand15" + }, + { + "name": "Brand16" + }, + { + "name": "Brand17" + } + ], + "pageInfo": { + "endCursor": "e31CcmFuZDE3OjE4" + } + } + }, + "extensions": { + "sql": "-- @p='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Name\", b.\"Id\"\nLIMIT @p" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/EntityFrameworkExecutableTests.cs b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/EntityFrameworkExecutableTests.cs index 5aefc33dc15..28c8c3fd920 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/EntityFrameworkExecutableTests.cs +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/EntityFrameworkExecutableTests.cs @@ -57,7 +57,10 @@ public async Task ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault() var result = await executable.SingleOrDefaultAsync(default); // assert - new { result, executable = executable.Print(), }.MatchSnapshot(); + new { result, executable = executable.Print(), }.MatchSnapshot( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null); } [Fact] diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap new file mode 100644 index 00000000000..94b00172d25 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap @@ -0,0 +1,14 @@ +{ + "result": { + "Id": 1, + "Name": "Foo", + "Books": [ + { + "Id": 1, + "AuthorId": 1, + "Title": "Foo1" + } + ] + }, + "executable": ".param set @p 1\n\nSELECT \"a\".\"Id\", \"a\".\"Name\"\nFROM \"Authors\" AS \"a\"\nLIMIT @p" +} diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs index 5e4ac207edc..3b756b89190 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs @@ -37,7 +37,11 @@ public async Task Filter_With_Expression() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -69,7 +73,11 @@ public async Task Filter_With_Multi_Expression() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -101,7 +109,11 @@ public async Task Filter_With_Filtering() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -133,7 +145,11 @@ public async Task Filter_With_Expression_Null() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs index 38f7cc4f4ba..44973674457 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs @@ -38,7 +38,10 @@ public async Task Create_BooleanEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "true") .AddResult(res2, "false") .MatchAsync(); @@ -63,7 +66,10 @@ public async Task Create_BooleanNotEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "true") .AddResult(res2, "false") .MatchAsync(); @@ -93,7 +99,10 @@ public async Task Create_NullableBooleanEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "true") .AddResult(res2, "false") .AddResult(res3, "null") @@ -125,7 +134,10 @@ public async Task Create_NullableBooleanNotEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "true") .AddResult(res2, "false") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs index 3756fc091b7..0751798aa57 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs @@ -45,7 +45,10 @@ public async Task Create_ShortEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -76,7 +79,10 @@ public async Task Create_ShortNotEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -112,7 +118,10 @@ public async Task Create_ShortGreaterThan_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -149,7 +158,10 @@ public async Task Create_ShortNotGreaterThan_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -186,7 +198,10 @@ public async Task Create_ShortGreaterThanOrEquals_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -223,7 +238,10 @@ public async Task Create_ShortNotGreaterThanOrEquals_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -260,7 +278,10 @@ public async Task Create_ShortLowerThan_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -297,7 +318,10 @@ public async Task Create_ShortNotLowerThan_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -334,7 +358,10 @@ public async Task Create_ShortLowerThanOrEquals_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -371,7 +398,10 @@ public async Task Create_ShortNotLowerThanOrEquals_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -403,7 +433,10 @@ public async Task Create_ShortIn_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "nullAnd14") @@ -434,7 +467,10 @@ public async Task Create_ShortNotIn_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "nullAnd14") @@ -465,7 +501,10 @@ public async Task Create_ShortNullableEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -496,7 +535,10 @@ public async Task Create_ShortNullableNotEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -532,7 +574,10 @@ public async Task Create_ShortNullableGreaterThan_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -606,7 +651,10 @@ public async Task Create_ShortNullableGreaterThanOrEquals_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -680,7 +728,10 @@ public async Task Create_ShortNullableLowerThan_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -754,7 +805,10 @@ public async Task Create_ShortNullableLowerThanOrEquals_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs index 80422549b99..4096ca84d0f 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs @@ -47,7 +47,10 @@ public async Task Create_EnumEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -78,7 +81,10 @@ public async Task Create_EnumNotEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -109,7 +115,10 @@ public async Task Create_EnumIn_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -140,7 +149,10 @@ public async Task Create_EnumNotIn_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -172,7 +184,10 @@ public async Task Create_NullableEnumEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -203,7 +218,10 @@ public async Task Create_NullableEnumNotEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs index 626cbbc29b4..6a4cb343ac3 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs @@ -54,7 +54,10 @@ public async Task Create_StringConcatExpression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "Sam_Sampleman") .AddResult(res2, "NoMatch") .AddResult(res3, "null") @@ -85,7 +88,10 @@ public async Task Create_CollectionLengthExpression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "1") .AddResult(res2, "0") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorInterfacesTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorInterfacesTests.cs index ee6c6811c69..c68ca03b250 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorInterfacesTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorInterfacesTests.cs @@ -54,7 +54,10 @@ public async Task Create_InterfaceStringEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "a") .AddResult(res2, "ba") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs index 4391d0ccb15..b51a07c79c5 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs @@ -96,7 +96,10 @@ public async Task Create_ArraySomeObjectStringEqualWithNull_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "a") .AddResult(res2, "d") .AddResult(res3, "null") @@ -130,7 +133,10 @@ public async Task Create_ArrayNoneObjectStringEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "a") .AddResult(res2, "d") .AddResult(res3, "null") @@ -164,7 +170,10 @@ public async Task Create_ArrayAllObjectStringEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "a") .AddResult(res2, "d") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs index 6bc38e62627..c23ae6a96b4 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs @@ -139,7 +139,10 @@ public async Task Create_ObjectShortEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -176,7 +179,10 @@ public async Task Create_ObjectShortIn_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "nullAnd14") @@ -213,7 +219,10 @@ public async Task Create_ObjectNullableShortEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -280,7 +289,10 @@ public async Task Create_ObjectBooleanEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "true") .AddResult(res2, "false") .MatchAsync(); @@ -316,7 +328,10 @@ public async Task Create_ObjectNullableBooleanEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "true") .AddResult(res2, "false") .AddResult(res3, "null") @@ -353,7 +368,10 @@ public async Task Create_ObjectEnumEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -390,7 +408,10 @@ public async Task Create_ObjectEnumIn_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -428,7 +449,10 @@ public async Task Create_ObjectNullableEnumEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -501,7 +525,10 @@ public async Task Create_ObjectStringEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -539,7 +566,10 @@ public async Task Create_ObjectStringIn_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "testatestAndtestb") .AddResult(res2, "testbtestAndNull") .AddResult(res3, "testatest") @@ -579,7 +609,10 @@ public async Task Create_ArrayObjectNestedArraySomeStringEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") @@ -655,7 +688,10 @@ public async Task Create_ObjectStringEqual_Flattened() Assert.Null(Assert.IsType(res2).Errors); Assert.Null(Assert.IsType(res3).Errors); await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -695,7 +731,10 @@ public async Task Create_ObjectStringEquals_Related_Flattened() Assert.Null(Assert.IsType(res2).Errors); Assert.Null(Assert.IsType(res3).Errors); await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs index 84dd357f0e2..71f128768fd 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs @@ -43,7 +43,10 @@ public async Task Create_StringEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -74,7 +77,10 @@ public async Task Create_StringNotEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -106,7 +112,10 @@ public async Task Create_StringIn_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "testatestAndtestb") .AddResult(res2, "testbtestAndNull") .AddResult(res3, "testatest") @@ -169,7 +178,10 @@ public async Task Create_StringContains_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") @@ -356,7 +368,10 @@ public async Task Create_NullableStringEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -388,7 +403,10 @@ public async Task Create_NullableStringNotEqual_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -485,7 +503,10 @@ public async Task Create_NullableStringContains_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_NET10_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_NET10_0.md new file mode 100644 index 00000000000..e706680c0f6 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_NET10_0.md @@ -0,0 +1,27 @@ +# Filter_With_Expression + +## SQL + +```text +.param set @keys '[1]' + +SELECT "b"."Id", "b"."DisplayName", "b"."Name", "b"."Details_Country_Name" +FROM "Brands" AS "b" +WHERE "b"."Id" IN ( + SELECT "k"."value" + FROM json_each(@keys) AS "k" +) AND "b"."Name" LIKE 'Brand%' +``` + +## Result + +```json +{ + "data": { + "filterExpression": { + "name": "Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null_NET10_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null_NET10_0.md new file mode 100644 index 00000000000..658334ae030 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null_NET10_0.md @@ -0,0 +1,27 @@ +# Filter_With_Expression_Null + +## SQL + +```text +.param set @keys '[1]' + +SELECT "b"."Id", "b"."DisplayName", "b"."Name", "b"."Details_Country_Name" +FROM "Brands" AS "b" +WHERE "b"."Id" IN ( + SELECT "k"."value" + FROM json_each(@keys) AS "k" +) +``` + +## Result + +```json +{ + "data": { + "brandByIdFilterNull": { + "name": "Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering_NET10_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering_NET10_0.md new file mode 100644 index 00000000000..9cc3a018f9d --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering_NET10_0.md @@ -0,0 +1,30 @@ +# Filter_With_Filtering + +## SQL + +```text +.param set @keys '[1]' +.param set @p_startswith 'Product%' + +SELECT "p"."Id", "p"."AvailableStock", "p"."BrandId", "p"."Description", "p"."ImageFileName", "p"."MaxStockThreshold", "p"."Name", "p"."OnReorder", "p"."Price", "p"."RestockThreshold", "p"."TypeId" +FROM "Products" AS "p" +WHERE "p"."BrandId" IN ( + SELECT "k"."value" + FROM json_each(@keys) AS "k" +) AND "p"."Name" LIKE @p_startswith ESCAPE '\' +``` + +## Result + +```json +{ + "data": { + "filterContext": [ + { + "name": "Product 0-0" + } + ] + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET10_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET10_0.md new file mode 100644 index 00000000000..4c578a9a8e0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET10_0.md @@ -0,0 +1,27 @@ +# Filter_With_Multi_Expression + +## SQL + +```text +.param set @keys '[1]' + +SELECT "b"."Id", "b"."DisplayName", "b"."Name", "b"."Details_Country_Name" +FROM "Brands" AS "b" +WHERE "b"."Id" IN ( + SELECT "k"."value" + FROM json_each(@keys) AS "k" +) AND "b"."Name" LIKE 'Brand%' AND "b"."Name" LIKE '%0' +``` + +## Result + +```json +{ + "data": { + "multiFilterExpression": { + "name": "Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_BooleanEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_BooleanEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..5df6d05dcd2 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_BooleanEqual_Expression_NET10_0.snap @@ -0,0 +1,43 @@ +true Result: +--------------- +{ + "data": { + "root": [ + { + "bar": true + } + ] + } +} +--------------- + +true SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" = @p +--------------- + +false Result: +--------------- +{ + "data": { + "root": [ + { + "bar": false + } + ] + } +} +--------------- + +false SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" = @p +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_BooleanNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_BooleanNotEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..5e926877578 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_BooleanNotEqual_Expression_NET10_0.snap @@ -0,0 +1,43 @@ +true Result: +--------------- +{ + "data": { + "root": [ + { + "bar": false + } + ] + } +} +--------------- + +true SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" <> @p +--------------- + +false Result: +--------------- +{ + "data": { + "root": [ + { + "bar": true + } + ] + } +} +--------------- + +false SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" <> @p +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..f458a1c5844 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression_NET10_0.snap @@ -0,0 +1,63 @@ +true Result: +--------------- +{ + "data": { + "root": [ + { + "bar": true + } + ] + } +} +--------------- + +true SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" = @p +--------------- + +false Result: +--------------- +{ + "data": { + "root": [ + { + "bar": false + } + ] + } +} +--------------- + +false SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" = @p +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "bar": null + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..66aef7e7af7 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET10_0.snap @@ -0,0 +1,72 @@ +true Result: +--------------- +{ + "data": { + "root": [ + { + "bar": null + }, + { + "bar": false + } + ] + } +} +--------------- + +true SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL +--------------- + +false Result: +--------------- +{ + "data": { + "root": [ + { + "bar": true + }, + { + "bar": null + } + ] + } +} +--------------- + +false SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "bar": true + }, + { + "bar": false + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NOT NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..db3bf4a24b4 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" = @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" = @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `eq` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThanOrEquals_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThanOrEquals_Expression_NET10_0.snap new file mode 100644 index 00000000000..6a883fa3fa1 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThanOrEquals_Expression_NET10_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `gte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThan_Expression_NET10_0.snap new file mode 100644 index 00000000000..59c6f1619da --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThan_Expression_NET10_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `gt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..f15e5e79f8e --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET10_0.snap @@ -0,0 +1,83 @@ +12and13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12and13 SQL: +--------------- +.param set @p '[12,13]' + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +13and14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13and14 SQL: +--------------- +.param set @p '[13,14]' + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +nullAnd14 +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `in` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "[Short!]", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThanOrEquals_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThanOrEquals_Expression_NET10_0.snap new file mode 100644 index 00000000000..63a34989ec9 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThanOrEquals_Expression_NET10_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `lte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThan_Expression_NET10_0.snap new file mode 100644 index 00000000000..6cc8d7f6821 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThan_Expression_NET10_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `lt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..b4cdf6cf28e --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotEqual_Expression_NET10_0.snap @@ -0,0 +1,77 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <> @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <> @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `neq` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThanOrEquals_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThanOrEquals_Expression_NET10_0.snap new file mode 100644 index 00000000000..925ef96bc4e --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThanOrEquals_Expression_NET10_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `ngte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThan_Expression_NET10_0.snap new file mode 100644 index 00000000000..407a872dd15 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThan_Expression_NET10_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `ngt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..f8bc24c217f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET10_0.snap @@ -0,0 +1,77 @@ +12and13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +12and13 SQL: +--------------- +.param set @p '[12,13]' + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +13and14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +13and14 SQL: +--------------- +.param set @p '[13,14]' + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +nullAnd14 +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nin` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "[Short!]", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThanOrEquals_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThanOrEquals_Expression_NET10_0.snap new file mode 100644 index 00000000000..712a3b28bb5 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThanOrEquals_Expression_NET10_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nlte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThan_Expression_NET10_0.snap new file mode 100644 index 00000000000..8d9e9239a07 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThan_Expression_NET10_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nlt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..aae7a91081f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableEqual_Expression_NET10_0.snap @@ -0,0 +1,63 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" = @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" = @p +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThanOrEquals_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThanOrEquals_Expression_NET10_0.snap new file mode 100644 index 00000000000..50376b84291 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThanOrEquals_Expression_NET10_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `gte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression_NET10_0.snap new file mode 100644 index 00000000000..c1bea0679f4 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression_NET10_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `gt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..c09e0d6df4d --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET10_0.snap @@ -0,0 +1,83 @@ +12and13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12and13 SQL: +--------------- +.param set @p '[12,13]' + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +13and14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13and14 SQL: +--------------- +.param set @p '[13,14]' + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +13andNull Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13andNull SQL: +--------------- +.param set @p_without_nulls '[13]' + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@p_without_nulls) AS "p" +) OR "d"."BarShort" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThanOrEquals_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThanOrEquals_Expression_NET10_0.snap new file mode 100644 index 00000000000..180a1a6ee28 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThanOrEquals_Expression_NET10_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `lte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThan_Expression_NET10_0.snap new file mode 100644 index 00000000000..54e49a5f24e --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThan_Expression_NET10_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @p +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `lt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..6f3647798f5 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET10_0.snap @@ -0,0 +1,81 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <> @p OR "d"."BarShort" IS NULL +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": null + }, + { + "barShort": 14 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <> @p OR "d"."BarShort" IS NULL +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" IS NOT NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET10_0.snap new file mode 100644 index 00000000000..6d5f2c7b459 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET10_0.snap @@ -0,0 +1,111 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" >= @p THEN 0 + ELSE 1 +END +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": null + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" >= @p THEN 0 + ELSE 1 +END +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": null + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" >= @p THEN 0 + ELSE 1 +END +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `ngte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET10_0.snap new file mode 100644 index 00000000000..718eb6a6bd2 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET10_0.snap @@ -0,0 +1,120 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": null + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" > @p THEN 0 + ELSE 1 +END +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": null + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" > @p THEN 0 + ELSE 1 +END +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": null + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" > @p THEN 0 + ELSE 1 +END +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `ngt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..e79cc89249a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET10_0.snap @@ -0,0 +1,83 @@ +12and13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + }, + { + "barShort": 14 + } + ] + } +} +--------------- + +12and13 SQL: +--------------- +.param set @p '[12,13]' + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) OR "d"."BarShort" IS NULL +--------------- + +13and14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": null + } + ] + } +} +--------------- + +13and14 SQL: +--------------- +.param set @p '[13,14]' + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) OR "d"."BarShort" IS NULL +--------------- + +13andNull Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + } + ] + } +} +--------------- + +13andNull SQL: +--------------- +.param set @p_without_nulls '[13]' + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" NOT IN ( + SELECT "p"."value" + FROM json_each(@p_without_nulls) AS "p" +) AND "d"."BarShort" IS NOT NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET10_0.snap new file mode 100644 index 00000000000..8494dd7ad32 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET10_0.snap @@ -0,0 +1,111 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" <= @p THEN 0 + ELSE 1 +END +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + }, + { + "barShort": 14 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" <= @p THEN 0 + ELSE 1 +END +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" <= @p THEN 0 + ELSE 1 +END +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nlte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET10_0.snap new file mode 100644 index 00000000000..9af33117708 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET10_0.snap @@ -0,0 +1,120 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": null + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" < @p THEN 0 + ELSE 1 +END +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" < @p THEN 0 + ELSE 1 +END +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + }, + { + "barShort": 14 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @p 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" < @p THEN 0 + ELSE 1 +END +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nlt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..efdcd684f79 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +BAR Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAR" + } + ] + } +} +--------------- + +BAR SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" = @p +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "FOO" + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" = @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `eq` of type FooEnumOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 32 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "FooEnum!", + "filterType": "FooEnumOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..a6e01270056 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET10_0.snap @@ -0,0 +1,78 @@ +BarAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAR" + }, + { + "barEnum": "FOO" + } + ] + } +} +--------------- + +BarAndFoo SQL: +--------------- +.param set @p '[1,0]' + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "FOO" + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p '[0]' + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +nullAndFoo Result: +--------------- +{ + "errors": [ + { + "message": "The specified value type of field `in` does not match the field type.", + "locations": [ + { + "line": 1, + "column": 32 + } + ], + "path": [ + "root" + ], + "extensions": { + "fieldName": "in", + "fieldType": "[FooEnum!]", + "locationType": "[FooEnum!]", + "specifiedBy": "https://spec.graphql.org/October2021/#sec-Values-of-Correct-Type" + } + } + ] +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..70e79e6972d --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression_NET10_0.snap @@ -0,0 +1,83 @@ +BAR Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAZ" + }, + { + "barEnum": "FOO" + }, + { + "barEnum": "QUX" + } + ] + } +} +--------------- + +BAR SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" <> @p +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAR" + }, + { + "barEnum": "BAZ" + }, + { + "barEnum": "QUX" + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" <> @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `neq` of type FooEnumOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "FooEnum!", + "filterType": "FooEnumOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..5cfbdd10b8a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET10_0.snap @@ -0,0 +1,84 @@ +BarAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAZ" + }, + { + "barEnum": "QUX" + } + ] + } +} +--------------- + +BarAndFoo SQL: +--------------- +.param set @p '[1,0]' + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAR" + }, + { + "barEnum": "BAZ" + }, + { + "barEnum": "QUX" + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p '[0]' + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +nullAndFoo Result: +--------------- +{ + "errors": [ + { + "message": "The specified value type of field `nin` does not match the field type.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "fieldName": "nin", + "fieldType": "[FooEnum!]", + "locationType": "[FooEnum!]", + "specifiedBy": "https://spec.graphql.org/October2021/#sec-Values-of-Correct-Type" + } + } + ] +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..a1a3271c78b --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression_NET10_0.snap @@ -0,0 +1,63 @@ +BAR Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAR" + } + ] + } +} +--------------- + +BAR SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" = @p +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "FOO" + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" = @p +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": null + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..36d7233accc --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET10_0.snap @@ -0,0 +1,80 @@ +BarAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAR" + }, + { + "barEnum": "FOO" + } + ] + } +} +--------------- + +BarAndFoo SQL: +--------------- +.param set @p '[1,0]' + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "FOO" + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p '[0]' + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +nullAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "FOO" + }, + { + "barEnum": null + } + ] + } +} +--------------- + +nullAndFoo SQL: +--------------- +.param set @p_without_nulls '[0]' + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@p_without_nulls) AS "p" +) OR "d"."BarEnum" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..05109068c3f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET10_0.snap @@ -0,0 +1,90 @@ +BAR Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAZ" + }, + { + "barEnum": "FOO" + }, + { + "barEnum": null + }, + { + "barEnum": "QUX" + } + ] + } +} +--------------- + +BAR SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" <> @p OR "d"."BarEnum" IS NULL +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAR" + }, + { + "barEnum": "BAZ" + }, + { + "barEnum": null + }, + { + "barEnum": "QUX" + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" <> @p OR "d"."BarEnum" IS NULL +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAR" + }, + { + "barEnum": "BAZ" + }, + { + "barEnum": "FOO" + }, + { + "barEnum": "QUX" + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" IS NOT NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..f6996cdd11a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET10_0.snap @@ -0,0 +1,95 @@ +BarAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAZ" + }, + { + "barEnum": null + }, + { + "barEnum": "QUX" + } + ] + } +} +--------------- + +BarAndFoo SQL: +--------------- +.param set @p '[1,0]' + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) OR "d"."BarEnum" IS NULL +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAR" + }, + { + "barEnum": "BAZ" + }, + { + "barEnum": null + }, + { + "barEnum": "QUX" + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p '[0]' + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) OR "d"."BarEnum" IS NULL +--------------- + +nullAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "barEnum": "BAR" + }, + { + "barEnum": "BAZ" + }, + { + "barEnum": "QUX" + } + ] + } +} +--------------- + +nullAndFoo SQL: +--------------- +.param set @p_without_nulls '[0]' + +SELECT "d"."Id", "d"."BarEnum" +FROM "Data" AS "d" +WHERE "d"."BarEnum" NOT IN ( + SELECT "p"."value" + FROM json_each(@p_without_nulls) AS "p" +) AND "d"."BarEnum" IS NOT NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression_NET10_0.snap new file mode 100644 index 00000000000..ef7a8b954f0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression_NET10_0.snap @@ -0,0 +1,79 @@ +1 Result: +--------------- +{ + "data": { + "root": [ + { + "name": "Foo", + "lastName": "Galoo" + } + ] + } +} +--------------- + +1 SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."LastName", "d"."Name" +FROM "Data" AS "d" +WHERE ( + SELECT COUNT(*) + FROM "Bar" AS "b" + WHERE "d"."Id" = "b"."FooId") = @p +--------------- + +0 Result: +--------------- +{ + "data": { + "root": [ + { + "name": "Sam", + "lastName": "Sampleman" + } + ] + } +} +--------------- + +0 SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."LastName", "d"."Name" +FROM "Data" AS "d" +WHERE ( + SELECT COUNT(*) + FROM "Bar" AS "b" + WHERE "d"."Id" = "b"."FooId") = @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `eq` of type IntOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Int!", + "filterType": "IntOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET10_0.snap new file mode 100644 index 00000000000..fe3e80799ce --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET10_0.snap @@ -0,0 +1,56 @@ +Sam_Sampleman Result: +--------------- +{ + "data": { + "root": [ + { + "name": "Sam", + "lastName": "Sampleman" + } + ] + } +} +--------------- + +Sam_Sampleman SQL: +--------------- +.param set @p 'Sam Sampleman' + +SELECT "d"."Id", "d"."LastName", "d"."Name" +FROM "Data" AS "d" +WHERE COALESCE("d"."Name", '') || ' ' || COALESCE("d"."LastName", '') = @p +--------------- + +NoMatch Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +NoMatch SQL: +--------------- +.param set @p 'NoMatch' + +SELECT "d"."Id", "d"."LastName", "d"."Name" +FROM "Data" AS "d" +WHERE COALESCE("d"."Name", '') || ' ' || COALESCE("d"."LastName", '') = @p +--------------- + +null Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."LastName", "d"."Name" +FROM "Data" AS "d" +WHERE 0 +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..245c50adcc7 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression_NET10_0.snap @@ -0,0 +1,77 @@ +a Result: +--------------- +{ + "data": { + "root": [ + { + "test": { + "prop": "a" + } + } + ] + } +} +--------------- + +a SQL: +--------------- +.param set @p 'a' + +SELECT "d"."Id", "d"."TestId" +FROM "Data" AS "d" +INNER JOIN "Test" AS "t" ON "d"."TestId" = "t"."Id" +WHERE "t"."Prop" = @p +--------------- + +ba Result: +--------------- +{ + "data": { + "root": [ + { + "test": { + "prop": "b" + } + } + ] + } +} +--------------- + +ba SQL: +--------------- +.param set @p 'b' + +SELECT "d"."Id", "d"."TestId" +FROM "Data" AS "d" +INNER JOIN "Test" AS "t" ON "d"."TestId" = "t"."Id" +WHERE "t"."Prop" = @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `eq` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 37 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..a30b15c44e3 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET10_0.snap @@ -0,0 +1,74 @@ +a Result: +--------------- +{ + "data": { + "root": [ + { + "fooNested": [ + { + "bar": "a" + }, + { + "bar": "a" + }, + { + "bar": "a" + } + ] + } + ] + } +} +--------------- + +a SQL: +--------------- +.param set @p 'a' + +SELECT "d"."Id" +FROM "Data" AS "d" +WHERE NOT EXISTS ( + SELECT 1 + FROM "FooNested" AS "f" + WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @p OR "f"."Bar" IS NULL)) +--------------- + +d Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +d SQL: +--------------- +.param set @p 'd' + +SELECT "d"."Id" +FROM "Data" AS "d" +WHERE NOT EXISTS ( + SELECT 1 + FROM "FooNested" AS "f" + WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @p OR "f"."Bar" IS NULL)) +--------------- + +null Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id" +FROM "Data" AS "d" +WHERE NOT EXISTS ( + SELECT 1 + FROM "FooNested" AS "f" + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" IS NOT NULL) +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..8125c203591 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET10_0.snap @@ -0,0 +1,167 @@ +a Result: +--------------- +{ + "data": { + "root": [ + { + "fooNested": [ + { + "bar": "c" + }, + { + "bar": "d" + }, + { + "bar": "b" + } + ] + }, + { + "fooNested": [ + { + "bar": null + }, + { + "bar": "d" + }, + { + "bar": "b" + } + ] + } + ] + } +} +--------------- + +a SQL: +--------------- +.param set @p 'a' + +SELECT "d"."Id" +FROM "Data" AS "d" +WHERE NOT EXISTS ( + SELECT 1 + FROM "FooNested" AS "f" + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) +--------------- + +d Result: +--------------- +{ + "data": { + "root": [ + { + "fooNested": [ + { + "bar": "a" + }, + { + "bar": "a" + }, + { + "bar": "a" + } + ] + }, + { + "fooNested": [ + { + "bar": "c" + }, + { + "bar": "a" + }, + { + "bar": "a" + } + ] + } + ] + } +} +--------------- + +d SQL: +--------------- +.param set @p 'd' + +SELECT "d"."Id" +FROM "Data" AS "d" +WHERE NOT EXISTS ( + SELECT 1 + FROM "FooNested" AS "f" + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "fooNested": [ + { + "bar": "a" + }, + { + "bar": "a" + }, + { + "bar": "a" + } + ] + }, + { + "fooNested": [ + { + "bar": "c" + }, + { + "bar": "a" + }, + { + "bar": "a" + } + ] + }, + { + "fooNested": [ + { + "bar": "a" + }, + { + "bar": "d" + }, + { + "bar": "b" + } + ] + }, + { + "fooNested": [ + { + "bar": "c" + }, + { + "bar": "d" + }, + { + "bar": "b" + } + ] + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id" +FROM "Data" AS "d" +WHERE NOT EXISTS ( + SELECT 1 + FROM "FooNested" AS "f" + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" IS NULL) +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET10_0.snap new file mode 100644 index 00000000000..8ab6907cc03 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET10_0.snap @@ -0,0 +1,154 @@ +a Result: +--------------- +{ + "data": { + "root": [ + { + "fooNested": [ + { + "bar": "a" + }, + { + "bar": "a" + }, + { + "bar": "a" + } + ] + }, + { + "fooNested": [ + { + "bar": "c" + }, + { + "bar": "a" + }, + { + "bar": "a" + } + ] + }, + { + "fooNested": [ + { + "bar": "a" + }, + { + "bar": "d" + }, + { + "bar": "b" + } + ] + } + ] + } +} +--------------- + +a SQL: +--------------- +.param set @p 'a' + +SELECT "d"."Id" +FROM "Data" AS "d" +WHERE EXISTS ( + SELECT 1 + FROM "FooNested" AS "f" + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) +--------------- + +d Result: +--------------- +{ + "data": { + "root": [ + { + "fooNested": [ + { + "bar": "a" + }, + { + "bar": "d" + }, + { + "bar": "b" + } + ] + }, + { + "fooNested": [ + { + "bar": "c" + }, + { + "bar": "d" + }, + { + "bar": "b" + } + ] + }, + { + "fooNested": [ + { + "bar": null + }, + { + "bar": "d" + }, + { + "bar": "b" + } + ] + } + ] + } +} +--------------- + +d SQL: +--------------- +.param set @p 'd' + +SELECT "d"."Id" +FROM "Data" AS "d" +WHERE EXISTS ( + SELECT 1 + FROM "FooNested" AS "f" + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "fooNested": [ + { + "bar": null + }, + { + "bar": "d" + }, + { + "bar": "b" + } + ] + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id" +FROM "Data" AS "d" +WHERE EXISTS ( + SELECT 1 + FROM "FooNested" AS "f" + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" IS NULL) +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..67fa1c8b66d --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET10_0.snap @@ -0,0 +1,73 @@ +a Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +a SQL: +--------------- +.param set @p 'a' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE EXISTS ( + SELECT 1 + FROM "Data" AS "d0" + INNER JOIN "Foo" AS "f0" ON "d0"."FooId" = "f0"."Id" + WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @p) +--------------- + +b Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +b SQL: +--------------- +.param set @p 'd' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE EXISTS ( + SELECT 1 + FROM "Data" AS "d0" + INNER JOIN "Foo" AS "f0" ON "d0"."FooId" = "f0"."Id" + WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @p) +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `eq` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 70 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectBooleanEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectBooleanEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..aa9671ed017 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectBooleanEqual_Expression_NET10_0.snap @@ -0,0 +1,64 @@ +true Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barBool": true + } + }, + { + "foo": { + "barBool": true + } + }, + { + "foo": { + "barBool": true + } + }, + { + "foo": { + "barBool": true + } + } + ] + } +} +--------------- + +true SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarBool" = @p +--------------- + +false Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barBool": false + } + } + ] + } +} +--------------- + +false SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarBool" = @p +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..5071856339a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression_NET10_0.snap @@ -0,0 +1,82 @@ +BAR Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "BAR" + } + }, + { + "foo": { + "barEnum": "BAR" + } + } + ] + } +} +--------------- + +BAR SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" = @p +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "FOO" + } + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" = @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `eq` of type BarEnumOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 39 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "BarEnum!", + "filterType": "BarEnumOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..1b4c8b0a90d --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET10_0.snap @@ -0,0 +1,91 @@ +BarAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "BAR" + } + }, + { + "foo": { + "barEnum": "BAR" + } + }, + { + "foo": { + "barEnum": "FOO" + } + } + ] + } +} +--------------- + +BarAndFoo SQL: +--------------- +.param set @p '[1,0]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "FOO" + } + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p '[0]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +nullAndFoo Result: +--------------- +{ + "errors": [ + { + "message": "The specified value type of field `in` does not match the field type.", + "locations": [ + { + "line": 1, + "column": 39 + } + ], + "path": [ + "root" + ], + "extensions": { + "fieldName": "in", + "fieldType": "[BarEnum!]", + "locationType": "[BarEnum!]", + "specifiedBy": "https://spec.graphql.org/October2021/#sec-Values-of-Correct-Type" + } + } + ] +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..a8119069e64 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression_NET10_0.snap @@ -0,0 +1,92 @@ +true Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barBool": true + } + }, + { + "foo": { + "barBool": true + } + } + ] + } +} +--------------- + +true SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarBool" = @p +--------------- + +false Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barBool": false + } + }, + { + "foo": { + "barBool": false + } + }, + { + "foo": { + "barBool": false + } + } + ] + } +} +--------------- + +false SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarBool" = @p +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barBool": null + } + }, + { + "foo": { + "barBool": null + } + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarBool" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..f2765c76788 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +BAR Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "BAR" + } + }, + { + "foo": { + "barEnum": "BAR" + } + } + ] + } +} +--------------- + +BAR SQL: +--------------- +.param set @p 1 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" = @p +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "FOO" + } + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p 0 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" = @p +--------------- + +null Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..3bc7f73e1c7 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET10_0.snap @@ -0,0 +1,93 @@ +BarAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "BAR" + } + }, + { + "foo": { + "barEnum": "BAR" + } + }, + { + "foo": { + "barEnum": "FOO" + } + } + ] + } +} +--------------- + +BarAndFoo SQL: +--------------- +.param set @p '[1,0]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "FOO" + } + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p '[0]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +nullAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "FOO" + } + } + ] + } +} +--------------- + +nullAndFoo SQL: +--------------- +.param set @p_without_nulls '[0]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@p_without_nulls) AS "p" +) OR "f"."BarEnum" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..e250bf97941 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression_NET10_0.snap @@ -0,0 +1,82 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": 12 + } + }, + { + "foo": { + "barShort": 12 + } + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" = @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": 13 + } + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" = @p +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": null + } + }, + { + "foo": { + "barShort": null + } + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..dae5f24795a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET10_0.snap @@ -0,0 +1,113 @@ +12and13 Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": 12 + } + }, + { + "foo": { + "barShort": 12 + } + }, + { + "foo": { + "barShort": 13 + } + } + ] + } +} +--------------- + +12and13 SQL: +--------------- +.param set @p '[12,13]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +13and14 Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": 14 + } + }, + { + "foo": { + "barShort": 14 + } + }, + { + "foo": { + "barShort": 13 + } + } + ] + } +} +--------------- + +13and14 SQL: +--------------- +.param set @p '[13,14]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +13andNull Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": null + } + }, + { + "foo": { + "barShort": null + } + }, + { + "foo": { + "barShort": 13 + } + } + ] + } +} +--------------- + +13andNull SQL: +--------------- +.param set @p_without_nulls '[13]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@p_without_nulls) AS "p" +) OR "f"."BarShort" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..c8b5e0e6aac --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression_NET10_0.snap @@ -0,0 +1,82 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": 12 + } + }, + { + "foo": { + "barShort": 12 + } + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @p 12 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" = @p +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": 13 + } + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @p 13 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" = @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `eq` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 40 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..374cb862564 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET10_0.snap @@ -0,0 +1,103 @@ +12and13 Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": 12 + } + }, + { + "foo": { + "barShort": 12 + } + }, + { + "foo": { + "barShort": 13 + } + } + ] + } +} +--------------- + +12and13 SQL: +--------------- +.param set @p '[12,13]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +13and14 Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": 14 + } + }, + { + "foo": { + "barShort": 14 + } + }, + { + "foo": { + "barShort": 13 + } + } + ] + } +} +--------------- + +13and14 SQL: +--------------- +.param set @p '[13,14]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +nullAnd14 +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `in` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 40 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "[Short!]", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..0b6a2b661c1 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression_NET10_0.snap @@ -0,0 +1,87 @@ +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest" + } + }, + { + "foo": { + "barString": "testatest" + } + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p 'testatest' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarString" = @p +--------------- + +testbtest Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testbtest" + } + }, + { + "foo": { + "barString": "testbtest" + } + } + ] + } +} +--------------- + +testbtest SQL: +--------------- +.param set @p 'testbtest' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarString" = @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `eq` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 41 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened_NET10_0.snap new file mode 100644 index 00000000000..31e0af75765 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened_NET10_0.snap @@ -0,0 +1,76 @@ +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest" + } + }, + { + "foo": { + "barString": "testatest" + } + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p 'testatest' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarString" = @p +--------------- + +testbtest Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testbtest" + } + }, + { + "foo": { + "barString": "testbtest" + } + } + ] + } +} +--------------- + +testbtest SQL: +--------------- +.param set @p 'testbtest' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarString" = @p +--------------- + +null Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE 0 +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened_NET10_0.snap new file mode 100644 index 00000000000..7a9d431d8b1 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened_NET10_0.snap @@ -0,0 +1,73 @@ +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": { + "foo": { + "barString": "testatest" + } + } + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p 'testatest' + +SELECT "d"."Id", "d"."BarId" +FROM "Data" AS "d" +INNER JOIN "Bar" AS "b" ON "d"."BarId" = "b"."Id" +INNER JOIN "Foo" AS "f" ON "b"."FooId" = "f"."Id" +WHERE "f"."BarString" = @p +--------------- + +testbtest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": { + "foo": { + "barString": "testbtest" + } + } + } + ] + } +} +--------------- + +testbtest SQL: +--------------- +.param set @p 'testbtest' + +SELECT "d"."Id", "d"."BarId" +FROM "Data" AS "d" +INNER JOIN "Bar" AS "b" ON "d"."BarId" = "b"."Id" +INNER JOIN "Foo" AS "f" ON "b"."FooId" = "f"."Id" +WHERE "f"."BarString" = @p +--------------- + +null Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."BarId" +FROM "Data" AS "d" +INNER JOIN "Bar" AS "b" ON "d"."BarId" = "b"."Id" +INNER JOIN "Foo" AS "f" ON "b"."FooId" = "f"."Id" +WHERE 0 +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..695885c6399 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET10_0.snap @@ -0,0 +1,103 @@ +testatestAndtestb Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest" + } + }, + { + "foo": { + "barString": "testatest" + } + }, + { + "foo": { + "barString": "testbtest" + } + }, + { + "foo": { + "barString": "testbtest" + } + } + ] + } +} +--------------- + +testatestAndtestb SQL: +--------------- +.param set @p '["testatest","testbtest"]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarString" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +testbtestAndNull +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `in` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 41 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "[String!]", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- + +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest" + } + }, + { + "foo": { + "barString": "testatest" + } + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p '["testatest"]' + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarString" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET10_0.snap new file mode 100644 index 00000000000..a0ace3f2075 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +a Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +a SQL: +--------------- +.param set @p 'a' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NOT NULL AND instr("d"."Bar", @p) > 0 +--------------- + +b Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +b SQL: +--------------- +.param set @p 'b' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NOT NULL AND instr("d"."Bar", @p) > 0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `contains` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET10_0.snap new file mode 100644 index 00000000000..0c6ddad2018 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +atest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +atest SQL: +--------------- +.param set @p_endswith '%atest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @p_endswith ESCAPE '\' +--------------- + +btest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +btest SQL: +--------------- +.param set @p_endswith '%btest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @p_endswith ESCAPE '\' +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `endsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..5614588b332 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression_NET10_0.snap @@ -0,0 +1,63 @@ +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p 'testatest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" = @p +--------------- + +testbtest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +testbtest SQL: +--------------- +.param set @p 'testbtest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" = @p +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "bar": null + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..cbb869e9448 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET10_0.snap @@ -0,0 +1,80 @@ +testatestAndtestb Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + }, + { + "bar": "testbtest" + } + ] + } +} +--------------- + +testatestAndtestb SQL: +--------------- +.param set @p '["testatest","testbtest"]' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +testbtestAndNull Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + }, + { + "bar": null + } + ] + } +} +--------------- + +testbtestAndNull SQL: +--------------- +.param set @p_without_nulls '["testbtest"]' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IN ( + SELECT "p"."value" + FROM json_each(@p_without_nulls) AS "p" +) OR "d"."Bar" IS NULL +--------------- + +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p '["testatest"]' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET10_0.snap new file mode 100644 index 00000000000..6a7609055ba --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET10_0.snap @@ -0,0 +1,77 @@ +a Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + }, + { + "bar": null + } + ] + } +} +--------------- + +a SQL: +--------------- +.param set @p 'a' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NULL OR instr("d"."Bar", @p) <= 0 +--------------- + +b Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + }, + { + "bar": null + } + ] + } +} +--------------- + +b SQL: +--------------- +.param set @p 'b' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NULL OR instr("d"."Bar", @p) <= 0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `ncontains` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET10_0.snap new file mode 100644 index 00000000000..40b5f71a248 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET10_0.snap @@ -0,0 +1,77 @@ +atest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + }, + { + "bar": null + } + ] + } +} +--------------- + +atest SQL: +--------------- +.param set @p_endswith '%atest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @p_endswith ESCAPE '\' +--------------- + +btest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + }, + { + "bar": null + } + ] + } +} +--------------- + +btest SQL: +--------------- +.param set @p_endswith '%btest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @p_endswith ESCAPE '\' +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nendsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..59770b8a362 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET10_0.snap @@ -0,0 +1,72 @@ +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + }, + { + "bar": null + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p 'testatest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL +--------------- + +testbtest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + }, + { + "bar": null + } + ] + } +} +--------------- + +testbtest SQL: +--------------- +.param set @p 'testbtest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + }, + { + "bar": "testbtest" + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NOT NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..bd4e2bbfcca --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET10_0.snap @@ -0,0 +1,77 @@ +testatestAndtestb Result: +--------------- +{ + "data": { + "root": [ + { + "bar": null + } + ] + } +} +--------------- + +testatestAndtestb SQL: +--------------- +.param set @p '["testatest","testbtest"]' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) OR "d"."Bar" IS NULL +--------------- + +testbtestAndNull Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +testbtestAndNull SQL: +--------------- +.param set @p_without_nulls '["testbtest"]' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" NOT IN ( + SELECT "p"."value" + FROM json_each(@p_without_nulls) AS "p" +) AND "d"."Bar" IS NOT NULL +--------------- + +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + }, + { + "bar": null + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p '["testatest"]' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) OR "d"."Bar" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET10_0.snap new file mode 100644 index 00000000000..46ef0aab7eb --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET10_0.snap @@ -0,0 +1,77 @@ +testa Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + }, + { + "bar": null + } + ] + } +} +--------------- + +testa SQL: +--------------- +.param set @p_startswith 'testa%' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @p_startswith ESCAPE '\' +--------------- + +testb Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + }, + { + "bar": null + } + ] + } +} +--------------- + +testb SQL: +--------------- +.param set @p_startswith 'testb%' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @p_startswith ESCAPE '\' +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nstartsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 37 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET10_0.snap new file mode 100644 index 00000000000..3455343eef2 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +testa Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +testa SQL: +--------------- +.param set @p_startswith 'testa%' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @p_startswith ESCAPE '\' +--------------- + +testb Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +testb SQL: +--------------- +.param set @p_startswith 'testb%' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @p_startswith ESCAPE '\' +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `startsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 36 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET10_0.snap new file mode 100644 index 00000000000..bcacc6b82ed --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +a Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +a SQL: +--------------- +.param set @p 'a' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE instr("d"."Bar", @p) > 0 +--------------- + +b Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +b SQL: +--------------- +.param set @p 'b' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE instr("d"."Bar", @p) > 0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `contains` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET10_0.snap new file mode 100644 index 00000000000..9854e976e49 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +atest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +atest SQL: +--------------- +.param set @p_endswith '%atest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" LIKE @p_endswith ESCAPE '\' +--------------- + +btest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +btest SQL: +--------------- +.param set @p_endswith '%btest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" LIKE @p_endswith ESCAPE '\' +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `endsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..30a4100fe0e --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p 'testatest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" = @p +--------------- + +testbtest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +testbtest SQL: +--------------- +.param set @p 'testbtest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" = @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `eq` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 28 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..c6bc61b4538 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET10_0.snap @@ -0,0 +1,80 @@ +testatestAndtestb Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + }, + { + "bar": "testbtest" + } + ] + } +} +--------------- + +testatestAndtestb SQL: +--------------- +.param set @p '["testatest","testbtest"]' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +testbtestAndNull +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `in` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 28 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "[String!]", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- + +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p '["testatest"]' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET10_0.snap new file mode 100644 index 00000000000..f27ccad99b5 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +a Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +a SQL: +--------------- +.param set @p 'a' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE instr("d"."Bar", @p) <= 0 +--------------- + +b Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +b SQL: +--------------- +.param set @p 'b' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE instr("d"."Bar", @p) <= 0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `ncontains` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET10_0.snap new file mode 100644 index 00000000000..1da2559cf8d --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +atest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +atest SQL: +--------------- +.param set @p_endswith '%atest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" NOT LIKE @p_endswith ESCAPE '\' +--------------- + +btest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +btest SQL: +--------------- +.param set @p_endswith '%btest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" NOT LIKE @p_endswith ESCAPE '\' +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nendsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression_NET10_0.snap new file mode 100644 index 00000000000..546ed5e6b5f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p 'testatest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" <> @p +--------------- + +testbtest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +testbtest SQL: +--------------- +.param set @p 'testbtest' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" <> @p +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `neq` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 29 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET10_0.snap new file mode 100644 index 00000000000..6fea27da820 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET10_0.snap @@ -0,0 +1,73 @@ +testatestAndtestb Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +testatestAndtestb SQL: +--------------- +.param set @p '["testatest","testbtest"]' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- + +testbtestAndNull +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nin` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 29 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "[String!]", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- + +testatest Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +testatest SQL: +--------------- +.param set @p '["testatest"]' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" NOT IN ( + SELECT "p"."value" + FROM json_each(@p) AS "p" +) +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET10_0.snap new file mode 100644 index 00000000000..550e068d623 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +testa Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +testa SQL: +--------------- +.param set @p_startswith 'testa%' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" NOT LIKE @p_startswith ESCAPE '\' +--------------- + +testb Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +testb SQL: +--------------- +.param set @p_startswith 'testb%' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" NOT LIKE @p_startswith ESCAPE '\' +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nstartsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 37 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET10_0.snap new file mode 100644 index 00000000000..f2b36f6c370 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET10_0.snap @@ -0,0 +1,71 @@ +testa Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testatest" + } + ] + } +} +--------------- + +testa SQL: +--------------- +.param set @p_startswith 'testa%' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" LIKE @p_startswith ESCAPE '\' +--------------- + +testb Result: +--------------- +{ + "data": { + "root": [ + { + "bar": "testbtest" + } + ] + } +} +--------------- + +testb SQL: +--------------- +.param set @p_startswith 'testb%' + +SELECT "d"."Id", "d"."Bar" +FROM "Data" AS "d" +WHERE "d"."Bar" LIKE @p_startswith ESCAPE '\' +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `startsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 36 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "String!", + "filterType": "StringOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/DataLoaderTests.cs b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/DataLoaderTests.cs index 22eef667bb1..544390af6aa 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/DataLoaderTests.cs +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/DataLoaderTests.cs @@ -127,11 +127,7 @@ file static class Extensions public static void MatchSnapshot( this TestQueryInterceptor queryInterceptor) { -#if NET9_0_OR_GREATER - var snapshot = Snapshot.Create(); -#else - var snapshot = Snapshot.Create(postFix: "_net_8_0"); -#endif + var snapshot = Snapshot.Create(postFix: TestEnvironment.TargetFramework); for (var i = 0; i < queryInterceptor.Queries.Count; i++) { diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/HotChocolate.Data.PostgreSQL.Tests.csproj b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/HotChocolate.Data.PostgreSQL.Tests.csproj index d6dc4996529..c9d4304d08a 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/HotChocolate.Data.PostgreSQL.Tests.csproj +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/HotChocolate.Data.PostgreSQL.Tests.csproj @@ -19,7 +19,6 @@ - diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IntegrationTests.cs b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IntegrationTests.cs index b0e243b52cf..67f10b4dbb6 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IntegrationTests.cs +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IntegrationTests.cs @@ -560,11 +560,7 @@ private static void MatchSnapshot( IExecutionResult result, TestQueryInterceptor queryInterceptor) { -#if NET9_0_OR_GREATER - var snapshot = Snapshot.Create(); -#else - var snapshot = Snapshot.Create(postFix: "_net_8_0"); -#endif + var snapshot = Snapshot.Create(postFix: TestEnvironment.TargetFramework); snapshot.Add(result.ToJson(), "Result", MarkdownLanguages.Json); diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET10_0.md new file mode 100644 index 00000000000..e68448b7da9 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET10_0.md @@ -0,0 +1,9 @@ +# Include_On_Array_Results + +```sql +-- @brandIds={ '1' } (DbType = Object) +SELECT p."BrandId", p."Name", p."Price" +FROM "Products" AS p +WHERE p."BrandId" = ANY (@brandIds) +ORDER BY p."BrandId" +``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET8_0.md similarity index 98% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET8_0.md index 33964c97293..ef523c16d18 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET8_0.md @@ -1,9 +1,9 @@ # Include_On_Array_Results ```sql --- @__brandIds_0={ '1' } (DbType = Object) -SELECT p."BrandId", p."Name", p."Price" -FROM "Products" AS p -WHERE p."BrandId" = ANY (@__brandIds_0) +-- @__brandIds_0={ '1' } (DbType = Object) +SELECT p."BrandId", p."Name", p."Price" +FROM "Products" AS p +WHERE p."BrandId" = ANY (@__brandIds_0) ORDER BY p."BrandId" ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET9_0.md similarity index 98% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET9_0.md index 33964c97293..ef523c16d18 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results__net_8_0.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET9_0.md @@ -1,9 +1,9 @@ # Include_On_Array_Results ```sql --- @__brandIds_0={ '1' } (DbType = Object) -SELECT p."BrandId", p."Name", p."Price" -FROM "Products" AS p -WHERE p."BrandId" = ANY (@__brandIds_0) +-- @__brandIds_0={ '1' } (DbType = Object) +SELECT p."BrandId", p."Name", p."Price" +FROM "Products" AS p +WHERE p."BrandId" = ANY (@__brandIds_0) ORDER BY p."BrandId" ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET10_0.md new file mode 100644 index 00000000000..8e1ea6921a5 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET10_0.md @@ -0,0 +1,9 @@ +# Include_On_List_Results + +```sql +-- @brandIds={ '1' } (DbType = Object) +SELECT p."BrandId", p."Name", p."Price" +FROM "Products" AS p +WHERE p."BrandId" = ANY (@brandIds) +ORDER BY p."BrandId" +``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET8_0.md similarity index 98% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET8_0.md index fbdb8d3c7c6..9133c40fdda 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results__net_8_0.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET8_0.md @@ -1,9 +1,9 @@ # Include_On_List_Results ```sql --- @__brandIds_0={ '1' } (DbType = Object) -SELECT p."BrandId", p."Name", p."Price" -FROM "Products" AS p -WHERE p."BrandId" = ANY (@__brandIds_0) +-- @__brandIds_0={ '1' } (DbType = Object) +SELECT p."BrandId", p."Name", p."Price" +FROM "Products" AS p +WHERE p."BrandId" = ANY (@__brandIds_0) ORDER BY p."BrandId" ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET9_0.md similarity index 98% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET9_0.md index fbdb8d3c7c6..9133c40fdda 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET9_0.md @@ -1,9 +1,9 @@ # Include_On_List_Results ```sql --- @__brandIds_0={ '1' } (DbType = Object) -SELECT p."BrandId", p."Name", p."Price" -FROM "Products" AS p -WHERE p."BrandId" = ANY (@__brandIds_0) +-- @__brandIds_0={ '1' } (DbType = Object) +SELECT p."BrandId", p."Name", p."Price" +FROM "Products" AS p +WHERE p."BrandId" = ANY (@__brandIds_0) ORDER BY p."BrandId" ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results_NET10_0.md new file mode 100644 index 00000000000..1e79aacfa22 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results_NET10_0.md @@ -0,0 +1,22 @@ +# Include_On_Page_Results + +```sql +-- @brandIds={ '1' } (DbType = Object) +SELECT p1."BrandId", p3."BrandId", p3."Name", p3."Price", p3."Id" +FROM ( + SELECT p."BrandId" + FROM "Products" AS p + WHERE p."BrandId" = ANY (@brandIds) + GROUP BY p."BrandId" +) AS p1 +LEFT JOIN ( + SELECT p2."BrandId", p2."Name", p2."Price", p2."Id" + FROM ( + SELECT p0."BrandId", p0."Name", p0."Price", p0."Id", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Id") AS row + FROM "Products" AS p0 + WHERE p0."BrandId" = ANY (@brandIds) + ) AS p2 + WHERE p2.row <= 6 +) AS p3 ON p1."BrandId" = p3."BrandId" +ORDER BY p1."BrandId", p3."BrandId", p3."Id" +``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET10_0.md similarity index 95% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET10_0.md index 1021cf04199..eae2bb6529a 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET10_0.md @@ -3,24 +3,24 @@ ## Result ```json -{ - "data": { - "singleProperties": [ - { - "id": "0" - }, - { - "id": "1" - } - ] - } +{ + "data": { + "singleProperties": [ + { + "id": "0" + }, + { + "id": "1" + } + ] + } } ``` ## Query 1 ```sql -SELECT s."Id" +SELECT s."Id" FROM "SingleProperties" AS s ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET8_0.md similarity index 95% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET8_0.md index 1021cf04199..eae2bb6529a 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored__net_8_0.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET8_0.md @@ -3,24 +3,24 @@ ## Result ```json -{ - "data": { - "singleProperties": [ - { - "id": "0" - }, - { - "id": "1" - } - ] - } +{ + "data": { + "singleProperties": [ + { + "id": "0" + }, + { + "id": "1" + } + ] + } } ``` ## Query 1 ```sql -SELECT s."Id" +SELECT s."Id" FROM "SingleProperties" AS s ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET9_0.md new file mode 100644 index 00000000000..eae2bb6529a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET9_0.md @@ -0,0 +1,26 @@ +# Ensure_That_Self_Requirement_Is_Honored + +## Result + +```json +{ + "data": { + "singleProperties": [ + { + "id": "0" + }, + { + "id": "1" + } + ] + } +} +``` + +## Query 1 + +```sql +SELECT s."Id" +FROM "SingleProperties" AS s +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET10_0.md similarity index 96% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET10_0.md index 30b6a3e0fdf..677c570c934 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET10_0.md @@ -3,24 +3,24 @@ ## Result ```json -{ - "data": { - "singleProperties": [ - { - "__typename": "SingleProperty" - }, - { - "__typename": "SingleProperty" - } - ] - } +{ + "data": { + "singleProperties": [ + { + "__typename": "SingleProperty" + }, + { + "__typename": "SingleProperty" + } + ] + } } ``` ## Query 1 ```sql -SELECT s."Id" +SELECT s."Id" FROM "SingleProperties" AS s ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET8_0.md similarity index 96% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET8_0.md index 30b6a3e0fdf..677c570c934 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable__net_8_0.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET8_0.md @@ -3,24 +3,24 @@ ## Result ```json -{ - "data": { - "singleProperties": [ - { - "__typename": "SingleProperty" - }, - { - "__typename": "SingleProperty" - } - ] - } +{ + "data": { + "singleProperties": [ + { + "__typename": "SingleProperty" + }, + { + "__typename": "SingleProperty" + } + ] + } } ``` ## Query 1 ```sql -SELECT s."Id" +SELECT s."Id" FROM "SingleProperties" AS s ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET9_0.md new file mode 100644 index 00000000000..677c570c934 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET9_0.md @@ -0,0 +1,26 @@ +# Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable + +## Result + +```json +{ + "data": { + "singleProperties": [ + { + "__typename": "SingleProperty" + }, + { + "__typename": "SingleProperty" + } + ] + } +} +``` + +## Query 1 + +```sql +SELECT s."Id" +FROM "SingleProperties" AS s +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_NET10_0.md new file mode 100644 index 00000000000..37bd7c1ebca --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_NET10_0.md @@ -0,0 +1,80 @@ +# Query_Brands_First_2_And_Products_First_2 + +## Result + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "id": "QnJhbmQ6MTE=", + "name": "Zephyr", + "products": { + "nodes": [ + { + "id": "UHJvZHVjdDoxMg==", + "name": "Powder Pro Snowboard" + }, + { + "id": "UHJvZHVjdDoyMw==", + "name": "Summit Pro Climbing Harness" + } + ] + } + }, + { + "id": "QnJhbmQ6MTM=", + "name": "XE", + "products": { + "nodes": [ + { + "id": "UHJvZHVjdDo3Nw==", + "name": "Survivor 2-Person Tent" + }, + { + "id": "UHJvZHVjdDo4MA==", + "name": "Pathfinder GPS Watch" + } + ] + } + } + ] + } + } +} +``` + +## Query 1 + +```sql +-- @p='3' +SELECT b."Id", b."Name" +FROM "Brands" AS b +ORDER BY b."Name" DESC, b."Id" +LIMIT @p +``` + +## Query 2 + +```sql +-- @brandIds={ '11', '13' } (DbType = Object) +SELECT p1."BrandId", p3."Id", p3."Name", p3."BrandId" +FROM ( + SELECT p."BrandId" + FROM "Products" AS p + WHERE p."BrandId" = ANY (@brandIds) + GROUP BY p."BrandId" +) AS p1 +LEFT JOIN ( + SELECT p2."Id", p2."Name", p2."BrandId" + FROM ( + SELECT p0."Id", p0."Name", p0."BrandId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Id") AS row + FROM "Products" AS p0 + WHERE p0."BrandId" = ANY (@brandIds) + ) AS p2 + WHERE p2.row <= 3 +) AS p3 ON p1."BrandId" = p3."BrandId" +ORDER BY p1."BrandId", p3."BrandId", p3."Id" +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name_NET10_0.md new file mode 100644 index 00000000000..35937ce4331 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name_NET10_0.md @@ -0,0 +1,99 @@ +# Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name + +## Result + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "id": "QnJhbmQ6MTE=", + "products": { + "nodes": [ + { + "id": "UHJvZHVjdDo0OA==", + "name": "Trailblazer 45L Backpack", + "brand": { + "name": "Zephyr" + } + }, + { + "id": "UHJvZHVjdDoyMw==", + "name": "Summit Pro Climbing Harness", + "brand": { + "name": "Zephyr" + } + } + ] + } + }, + { + "id": "QnJhbmQ6MTM=", + "products": { + "nodes": [ + { + "id": "UHJvZHVjdDo3Nw==", + "name": "Survivor 2-Person Tent", + "brand": { + "name": "XE" + } + }, + { + "id": "UHJvZHVjdDo4MA==", + "name": "Pathfinder GPS Watch", + "brand": { + "name": "XE" + } + } + ] + } + } + ] + } + } +} +``` + +## Query 1 + +```sql +-- @p='3' +SELECT b."Id", b."Name" +FROM "Brands" AS b +ORDER BY b."Name" DESC, b."Id" +LIMIT @p +``` + +## Query 2 + +```sql +-- @brandIds={ '11', '13' } (DbType = Object) +SELECT p1."BrandId", p3."Id", p3."Name", p3."BrandId" +FROM ( + SELECT p."BrandId" + FROM "Products" AS p + WHERE p."BrandId" = ANY (@brandIds) + GROUP BY p."BrandId" +) AS p1 +LEFT JOIN ( + SELECT p2."Id", p2."Name", p2."BrandId" + FROM ( + SELECT p0."Id", p0."Name", p0."BrandId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Name" DESC, p0."Id") AS row + FROM "Products" AS p0 + WHERE p0."BrandId" = ANY (@brandIds) + ) AS p2 + WHERE p2.row <= 3 +) AS p3 ON p1."BrandId" = p3."BrandId" +ORDER BY p1."BrandId", p3."BrandId", p3."Name" DESC, p3."Id" +``` + +## Query 3 + +```sql +-- @ids={ '11', '13' } (DbType = Object) +SELECT b."Id", b."Name" +FROM "Brands" AS b +WHERE b."Id" = ANY (@ids) +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_NET10_0.md new file mode 100644 index 00000000000..ba86ee4ac90 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_NET10_0.md @@ -0,0 +1,80 @@ +# Query_Brands_First_2_And_Products_First_2_Name_Desc + +## Result + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "id": "QnJhbmQ6MTE=", + "name": "Zephyr", + "products": { + "nodes": [ + { + "id": "UHJvZHVjdDo0OA==", + "name": "Trailblazer 45L Backpack" + }, + { + "id": "UHJvZHVjdDoyMw==", + "name": "Summit Pro Climbing Harness" + } + ] + } + }, + { + "id": "QnJhbmQ6MTM=", + "name": "XE", + "products": { + "nodes": [ + { + "id": "UHJvZHVjdDo3Nw==", + "name": "Survivor 2-Person Tent" + }, + { + "id": "UHJvZHVjdDo4MA==", + "name": "Pathfinder GPS Watch" + } + ] + } + } + ] + } + } +} +``` + +## Query 1 + +```sql +-- @p='3' +SELECT b."Id", b."Name" +FROM "Brands" AS b +ORDER BY b."Name" DESC, b."Id" +LIMIT @p +``` + +## Query 2 + +```sql +-- @brandIds={ '11', '13' } (DbType = Object) +SELECT p1."BrandId", p3."Id", p3."Name", p3."BrandId" +FROM ( + SELECT p."BrandId" + FROM "Products" AS p + WHERE p."BrandId" = ANY (@brandIds) + GROUP BY p."BrandId" +) AS p1 +LEFT JOIN ( + SELECT p2."Id", p2."Name", p2."BrandId" + FROM ( + SELECT p0."Id", p0."Name", p0."BrandId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Name" DESC, p0."Id") AS row + FROM "Products" AS p0 + WHERE p0."BrandId" = ANY (@brandIds) + ) AS p2 + WHERE p2.row <= 3 +) AS p3 ON p1."BrandId" = p3."BrandId" +ORDER BY p1."BrandId", p3."BrandId", p3."Name" DESC, p3."Id" +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET10_0.md new file mode 100644 index 00000000000..6af24ded56f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET10_0.md @@ -0,0 +1,33 @@ +# Query_Brands_First_2 + +## Result + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "id": "QnJhbmQ6MTE=", + "name": "Zephyr" + }, + { + "id": "QnJhbmQ6MTM=", + "name": "XE" + } + ] + } + } +} +``` + +## Query 1 + +```sql +-- @p='3' +SELECT b."Id", b."Name" +FROM "Brands" AS b +ORDER BY b."Name" DESC, b."Id" +LIMIT @p +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors_NET10_0.md new file mode 100644 index 00000000000..43096472334 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors_NET10_0.md @@ -0,0 +1,83 @@ +# Query_Brands_First_2_Products_First_2_ForwardCursors + +## Result + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Zephyr", + "products": { + "nodes": [ + { + "name": "Powder Pro Snowboard" + }, + { + "name": "Summit Pro Climbing Harness" + } + ], + "pageInfo": { + "forwardCursors": [ + { + "page": 2, + "cursor": "ezB8MXw2fTIz" + }, + { + "page": 3, + "cursor": "ezF8MXw2fTIz" + } + ] + } + } + } + ] + } + } +} +``` + +## Query 1 + +```sql +-- @p='2' +SELECT b."Name", b."Id" +FROM "Brands" AS b +ORDER BY b."Name" DESC, b."Id" +LIMIT @p +``` + +## Query 2 + +```sql +-- @brandIds={ '11' } (DbType = Object) +SELECT p."BrandId" AS "Key", count(*)::int AS "Count" +FROM "Products" AS p +WHERE p."BrandId" = ANY (@brandIds) +GROUP BY p."BrandId" +``` + +## Query 3 + +```sql +-- @brandIds={ '11' } (DbType = Object) +SELECT p1."BrandId", p3."Name", p3."Id", p3."BrandId" +FROM ( + SELECT p."BrandId" + FROM "Products" AS p + WHERE p."BrandId" = ANY (@brandIds) + GROUP BY p."BrandId" +) AS p1 +LEFT JOIN ( + SELECT p2."Name", p2."Id", p2."BrandId" + FROM ( + SELECT p0."Name", p0."Id", p0."BrandId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Id") AS row + FROM "Products" AS p0 + WHERE p0."BrandId" = ANY (@brandIds) + ) AS p2 + WHERE p2.row <= 3 +) AS p3 ON p1."BrandId" = p3."BrandId" +ORDER BY p1."BrandId", p3."BrandId", p3."Id" +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET10_0.md new file mode 100644 index 00000000000..fb9b9e85c21 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET10_0.md @@ -0,0 +1,65 @@ +# Query_Brands + +## Result + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "id": "QnJhbmQ6MTE=", + "name": "Zephyr" + }, + { + "id": "QnJhbmQ6MTM=", + "name": "XE" + }, + { + "id": "QnJhbmQ6Mw==", + "name": "WildRunner" + }, + { + "id": "QnJhbmQ6Nw==", + "name": "Solstix" + }, + { + "id": "QnJhbmQ6Ng==", + "name": "Raptor Elite" + }, + { + "id": "QnJhbmQ6NA==", + "name": "Quester" + }, + { + "id": "QnJhbmQ6MTI=", + "name": "Legend" + }, + { + "id": "QnJhbmQ6OA==", + "name": "Grolltex" + }, + { + "id": "QnJhbmQ6MTA=", + "name": "Green Equipment" + }, + { + "id": "QnJhbmQ6Mg==", + "name": "Gravitator" + } + ] + } + } +} +``` + +## Query 1 + +```sql +-- @p='11' +SELECT b."Id", b."Name" +FROM "Brands" AS b +ORDER BY b."Name" DESC, b."Id" +LIMIT @p +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET10_0.md new file mode 100644 index 00000000000..41d3ab4d4d2 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET10_0.md @@ -0,0 +1,24 @@ +# Query_Node_Brand + +## Result + +```json +{ + "data": { + "brand": { + "id": "QnJhbmQ6MQ==", + "name": "Daybird" + } + } +} +``` + +## Query 1 + +```sql +-- @ids={ '1' } (DbType = Object) +SELECT b."Id", b."Name" +FROM "Brands" AS b +WHERE b."Id" = ANY (@ids) +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET8_0.md similarity index 96% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET8_0.md index 4c1b8927623..860adc31838 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET8_0.md @@ -3,22 +3,22 @@ ## Result ```json -{ - "data": { - "brand": { - "id": "QnJhbmQ6MQ==", - "name": "Daybird" - } - } +{ + "data": { + "brand": { + "id": "QnJhbmQ6MQ==", + "name": "Daybird" + } + } } ``` ## Query 1 ```sql --- @__ids_0={ '1' } (DbType = Object) -SELECT b."Id", b."Name" -FROM "Brands" AS b +-- @__ids_0={ '1' } (DbType = Object) +SELECT b."Id", b."Name" +FROM "Brands" AS b WHERE b."Id" = ANY (@__ids_0) ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET9_0.md similarity index 96% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET9_0.md index 4c1b8927623..860adc31838 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand__net_8_0.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET9_0.md @@ -3,22 +3,22 @@ ## Result ```json -{ - "data": { - "brand": { - "id": "QnJhbmQ6MQ==", - "name": "Daybird" - } - } +{ + "data": { + "brand": { + "id": "QnJhbmQ6MQ==", + "name": "Daybird" + } + } } ``` ## Query 1 ```sql --- @__ids_0={ '1' } (DbType = Object) -SELECT b."Id", b."Name" -FROM "Brands" AS b +-- @__ids_0={ '1' } (DbType = Object) +SELECT b."Id", b."Name" +FROM "Brands" AS b WHERE b."Id" = ANY (@__ids_0) ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET10_0.md new file mode 100644 index 00000000000..a24ba1032f3 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET10_0.md @@ -0,0 +1,24 @@ +# Query_Node_Product + +## Result + +```json +{ + "data": { + "product": { + "id": "UHJvZHVjdDox", + "name": "Wanderer Black Hiking Boots" + } + } +} +``` + +## Query 1 + +```sql +-- @ids={ '1' } (DbType = Object) +SELECT p."Id", p."Name" +FROM "Products" AS p +WHERE p."Id" = ANY (@ids) +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET8_0.md similarity index 96% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET8_0.md index c9b8897909d..3bbe500d732 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET8_0.md @@ -3,22 +3,22 @@ ## Result ```json -{ - "data": { - "product": { - "id": "UHJvZHVjdDox", - "name": "Wanderer Black Hiking Boots" - } - } +{ + "data": { + "product": { + "id": "UHJvZHVjdDox", + "name": "Wanderer Black Hiking Boots" + } + } } ``` ## Query 1 ```sql --- @__ids_0={ '1' } (DbType = Object) -SELECT p."Id", p."Name" -FROM "Products" AS p +-- @__ids_0={ '1' } (DbType = Object) +SELECT p."Id", p."Name" +FROM "Products" AS p WHERE p."Id" = ANY (@__ids_0) ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET9_0.md similarity index 96% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET9_0.md index c9b8897909d..3bbe500d732 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product__net_8_0.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET9_0.md @@ -3,22 +3,22 @@ ## Result ```json -{ - "data": { - "product": { - "id": "UHJvZHVjdDox", - "name": "Wanderer Black Hiking Boots" - } - } +{ + "data": { + "product": { + "id": "UHJvZHVjdDox", + "name": "Wanderer Black Hiking Boots" + } + } } ``` ## Query 1 ```sql --- @__ids_0={ '1' } (DbType = Object) -SELECT p."Id", p."Name" -FROM "Products" AS p +-- @__ids_0={ '1' } (DbType = Object) +SELECT p."Id", p."Name" +FROM "Products" AS p WHERE p."Id" = ANY (@__ids_0) ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET10_0.md new file mode 100644 index 00000000000..9c42d2329c8 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET10_0.md @@ -0,0 +1,31 @@ +# Query_Products_Exclude_TotalCount + +## Result + +```json +{ + "data": { + "productsNonRelative": { + "nodes": [ + { + "name": "Zero Gravity Ski Goggles" + }, + { + "name": "Zenith Cycling Jersey" + } + ] + } + } +} +``` + +## Query 1 + +```sql +-- @p='3' +SELECT p."Name", p."Id" +FROM "Products" AS p +ORDER BY p."Name" DESC, p."Id" +LIMIT @p +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET10_0.md new file mode 100644 index 00000000000..ed4f2c36da7 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET10_0.md @@ -0,0 +1,46 @@ +# Query_Products_First_2_And_Brand + +## Result + +```json +{ + "data": { + "products": { + "nodes": [ + { + "name": "Zero Gravity Ski Goggles", + "brand": { + "name": "Gravitator" + } + }, + { + "name": "Zenith Cycling Jersey", + "brand": { + "name": "B&R" + } + } + ] + } + } +} +``` + +## Query 1 + +```sql +-- @p='3' +SELECT p."Name", p."BrandId", p."Id" +FROM "Products" AS p +ORDER BY p."Name" DESC, p."Id" +LIMIT @p +``` + +## Query 2 + +```sql +-- @ids={ '2', '5' } (DbType = Object) +SELECT b."Id", b."Name" +FROM "Brands" AS b +WHERE b."Id" = ANY (@ids) +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_NET10_0.md new file mode 100644 index 00000000000..890631d19a4 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_NET10_0.md @@ -0,0 +1,54 @@ +# Query_Products_First_2_With_4_EndCursors + +## Result + +```json +{ + "data": { + "products": { + "nodes": [ + { + "name": "Zero Gravity Ski Goggles", + "brand": { + "name": "Gravitator" + } + }, + { + "name": "Zenith Cycling Jersey", + "brand": { + "name": "B&R" + } + } + ], + "endCursors": [ + "ezB8MXwxMDF9WmVuaXRoIEN5Y2xpbmcgSmVyc2V5OjQ2", + "ezF8MXwxMDF9WmVuaXRoIEN5Y2xpbmcgSmVyc2V5OjQ2", + "ezJ8MXwxMDF9WmVuaXRoIEN5Y2xpbmcgSmVyc2V5OjQ2", + "ezN8MXwxMDF9WmVuaXRoIEN5Y2xpbmcgSmVyc2V5OjQ2" + ] + } + } +} +``` + +## Query 1 + +```sql +-- @p='3' +SELECT ( + SELECT count(*)::int + FROM "Products" AS p0) AS "TotalCount", p."Name", p."BrandId", p."Id" +FROM "Products" AS p +ORDER BY p."Name" DESC, p."Id" +LIMIT @p +``` + +## Query 2 + +```sql +-- @ids={ '2', '5' } (DbType = Object) +SELECT b."Id", b."Name" +FROM "Brands" AS b +WHERE b."Id" = ANY (@ids) +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET10_0.md new file mode 100644 index 00000000000..8559d97e196 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET10_0.md @@ -0,0 +1,56 @@ +# Query_Products_First_2_With_4_EndCursors_Skip_4 + +## Result + +```json +{ + "data": { + "products": { + "nodes": [ + { + "name": "Venture 2022 Snowboard", + "brand": { + "name": "Raptor Elite" + } + }, + { + "name": "VelociX 2000 Bike Helmet", + "brand": { + "name": "Raptor Elite" + } + } + ], + "endCursors": [ + "ezB8NHwxMDF9VmVsb2NpWCAyMDAwIEJpa2UgSGVsbWV0OjU4", + "ezF8NHwxMDF9VmVsb2NpWCAyMDAwIEJpa2UgSGVsbWV0OjU4", + "ezJ8NHwxMDF9VmVsb2NpWCAyMDAwIEJpa2UgSGVsbWV0OjU4", + "ezN8NHwxMDF9VmVsb2NpWCAyMDAwIEJpa2UgSGVsbWV0OjU4" + ] + } + } +} +``` + +## Query 1 + +```sql +-- @value='Zenith Cycling Jersey' +-- @value1='46' +-- @p0='3' +-- @p='6' +SELECT p."Name", p."BrandId", p."Id" +FROM "Products" AS p +WHERE p."Name" < @value OR (p."Name" = @value AND p."Id" > @value1) +ORDER BY p."Name" DESC, p."Id" +LIMIT @p0 OFFSET @p +``` + +## Query 2 + +```sql +-- @ids={ '6' } (DbType = Object) +SELECT b."Id", b."Name" +FROM "Brands" AS b +WHERE b."Id" = ANY (@ids) +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount_NET10_0.md new file mode 100644 index 00000000000..c4839e61d09 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount_NET10_0.md @@ -0,0 +1,34 @@ +# Query_Products_Include_TotalCount + +## Result + +```json +{ + "data": { + "productsNonRelative": { + "nodes": [ + { + "name": "Zero Gravity Ski Goggles" + }, + { + "name": "Zenith Cycling Jersey" + } + ], + "totalCount": 101 + } + } +} +``` + +## Query 1 + +```sql +-- @p='3' +SELECT ( + SELECT count(*)::int + FROM "Products" AS p0) AS "TotalCount", p."Name", p."Id" +FROM "Products" AS p +ORDER BY p."Name" DESC, p."Id" +LIMIT @p +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET10_0.md new file mode 100644 index 00000000000..796ac84d520 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET10_0.md @@ -0,0 +1,32 @@ +# Verify_That_PageInfo_Flag_Is_Correctly_Inferred + +## Result + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "products": { + "pageInfo": { + "endCursor": null + } + } + } + ] + } + } +} +``` + +## Query 1 + +```sql +-- @p='2' +SELECT b."Id", b."Name" +FROM "Brands" AS b +ORDER BY b."Name" DESC, b."Id" +LIMIT @p +``` + diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred__net_8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred__net_8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap new file mode 100644 index 00000000000..31df65122a5 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap @@ -0,0 +1,42 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectArray": [] + } + } + ] + } +} +--------------- + +SQL: +--------------- +.param set @p 'a' + +SELECT 1, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" + WHERE "f0"."BarString" = @p +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable_NET10_0.snap new file mode 100644 index 00000000000..0bdb930ce9e --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable_NET10_0.snap @@ -0,0 +1,45 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectArray": [] + } + }, + { + "foo": { + "objectArray": [] + } + }, + { + "foo": { + "objectArray": [] + } + }, + { + "foo": { + "objectArray": [] + } + } + ] + } +} +--------------- + +SQL: +--------------- +.param set @p 'a' + +SELECT "f"."Id" IS NOT NULL, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."Id" IS NOT NULL AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooNullableId" + FROM "BarNullableDeep" AS "b" + LEFT JOIN "FooDeep" AS "f0" ON "b"."FooId" = "f0"."Id" + WHERE "f0"."BarString" = @p +) AS "s" ON "f"."Id" = "s"."FooNullableId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap new file mode 100644 index 00000000000..76cb17c504e --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap @@ -0,0 +1,44 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectArray": [] + } + } + ] + } +} +--------------- + +SQL: +--------------- +.param set @p 'a' + +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" + WHERE "f0"."BarString" = @p +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET10_0.snap new file mode 100644 index 00000000000..fded5213df2 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET10_0.snap @@ -0,0 +1,49 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectArray": [] + } + }, + { + "foo": { + "barString": "testbtest", + "objectArray": [] + } + }, + { + "foo": { + "barString": "testctest", + "objectArray": [] + } + }, + { + "foo": { + "barString": "testdtest", + "objectArray": [] + } + } + ] + } +} +--------------- + +SQL: +--------------- +.param set @p 'a' + +SELECT "f"."Id" IS NOT NULL, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."Id" IS NOT NULL AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooNullableId" + FROM "BarNullableDeep" AS "b" + LEFT JOIN "FooDeep" AS "f0" ON "b"."FooId" = "f0"."Id" + WHERE "f0"."BarString" = @p +) AS "s" ON "f"."Id" = "s"."FooNullableId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap new file mode 100644 index 00000000000..10f30603053 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap @@ -0,0 +1,46 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap new file mode 100644 index 00000000000..cf394fbcfa0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap @@ -0,0 +1,48 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap new file mode 100644 index 00000000000..10f30603053 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap @@ -0,0 +1,46 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap new file mode 100644 index 00000000000..cf394fbcfa0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap @@ -0,0 +1,48 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap new file mode 100644 index 00000000000..10f30603053 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap @@ -0,0 +1,46 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap new file mode 100644 index 00000000000..cf394fbcfa0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap @@ -0,0 +1,48 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap new file mode 100644 index 00000000000..17e0b237d75 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET10_0.snap @@ -0,0 +1,70 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."BarShort", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap new file mode 100644 index 00000000000..f90b85ab008 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap @@ -0,0 +1,72 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."BarShort", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Tests/HotChocolate.Data.Tests.csproj b/src/HotChocolate/Data/test/Data.Tests/HotChocolate.Data.Tests.csproj index 91ecd48321c..0923606bac9 100644 --- a/src/HotChocolate/Data/test/Data.Tests/HotChocolate.Data.Tests.csproj +++ b/src/HotChocolate/Data/test/Data.Tests/HotChocolate.Data.Tests.csproj @@ -13,7 +13,6 @@ - diff --git a/src/HotChocolate/Data/test/Data.Tests/InterfaceIntegrationTests.cs b/src/HotChocolate/Data/test/Data.Tests/InterfaceIntegrationTests.cs index ca367ecb85c..f2feb34f1b2 100644 --- a/src/HotChocolate/Data/test/Data.Tests/InterfaceIntegrationTests.cs +++ b/src/HotChocolate/Data/test/Data.Tests/InterfaceIntegrationTests.cs @@ -64,11 +64,8 @@ public async Task Query_Owner_Animals() var operationResult = result.ExpectOperationResult(); -#if NET9_0_OR_GREATER - await Snapshot.Create("NET_9_0") -#else - await Snapshot.Create() -#endif + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(queries) .Add(operationResult.WithExtensions(ImmutableDictionary.Empty)) .MatchMarkdownAsync(); @@ -119,11 +116,8 @@ public async Task Query_Owner_Animals_With_TotalCount() var operationResult = result.ExpectOperationResult(); -#if NET9_0_OR_GREATER - await Snapshot.Create("NET_9_0") -#else - await Snapshot.Create() -#endif + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(queries) .Add(operationResult.WithExtensions(ImmutableDictionary.Empty)) .MatchMarkdownAsync(); @@ -178,11 +172,8 @@ ... on Cat { var operationResult = result.ExpectOperationResult(); -#if NET9_0_OR_GREATER - await Snapshot.Create("NET_9_0") -#else - await Snapshot.Create() -#endif + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(queries) .Add(operationResult.WithExtensions(ImmutableDictionary.Empty)) .MatchMarkdownAsync(); @@ -224,7 +215,11 @@ public async Task Query_Pets() var operationResult = result.ExpectOperationResult(); - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(operationResult.WithExtensions(ImmutableDictionary.Empty)) .MatchMarkdownAsync(); diff --git a/src/HotChocolate/Data/test/Data.Tests/PagingHelperIntegrationTests.cs b/src/HotChocolate/Data/test/Data.Tests/PagingHelperIntegrationTests.cs index 2b3e01ce311..5f4dc530676 100644 --- a/src/HotChocolate/Data/test/Data.Tests/PagingHelperIntegrationTests.cs +++ b/src/HotChocolate/Data/test/Data.Tests/PagingHelperIntegrationTests.cs @@ -58,7 +58,11 @@ public async Task GetDefaultPage() .Build()); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(); @@ -101,7 +105,11 @@ public async Task GetDefaultPage2() .Build()); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(); @@ -144,7 +152,11 @@ public async Task GetSecondPage_With_2_Items() .Build()); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(); @@ -196,7 +208,11 @@ public async Task GetDefaultPage_With_Nullable() .Build()); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(); @@ -248,7 +264,11 @@ public async Task GetDefaultPage_With_Nullable_SecondPage() .Build()); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(); @@ -300,7 +320,11 @@ public async Task GetDefaultPage_With_Nullable_Fallback() .Build()); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(); @@ -352,7 +376,11 @@ public async Task GetDefaultPage_With_Nullable_Fallback_SecondPage() .Build()); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(); @@ -404,7 +432,11 @@ public async Task GetDefaultPage_With_Deep() .Build()); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(); @@ -456,7 +488,11 @@ public async Task GetDefaultPage_With_Deep_SecondPage() .Build()); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(); @@ -509,11 +545,8 @@ public async Task Nested_Paging_First_2() // Assert var operationResult = result.ExpectOperationResult(); -#if NET8_0 - await Snapshot.Create() -#else - await Snapshot.Create("NET9_0") -#endif + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(queries) .Add(operationResult.WithExtensions(ImmutableDictionary.Empty)) .MatchMarkdownAsync(); @@ -567,11 +600,8 @@ public async Task Nested_Paging_First_2_With_Projections() // Assert var operationResult = result.ExpectOperationResult(); -#if NET8_0 - await Snapshot.Create() -#else - await Snapshot.Create("NET9_0") -#endif + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(queries) .Add(operationResult, "Result") .MatchMarkdownAsync(); @@ -593,7 +623,11 @@ public async Task Paging_Empty_PagingArgs() var result = await context.Brands.OrderBy(t => t.Name).ThenBy(t => t.Id).ToPageAsync(pagingArgs); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add( new @@ -625,7 +659,11 @@ public async Task Paging_First_5() var result = await context.Brands.OrderBy(t => t.Name).ThenBy(t => t.Id).ToPageAsync(pagingArgs); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add( new @@ -661,7 +699,11 @@ public async Task Paging_First_5_After_Id_13() var result = await context.Brands.OrderBy(t => t.Name).ThenBy(t => t.Id).ToPageAsync(pagingArgs); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add( new @@ -693,7 +735,11 @@ public async Task Paging_Last_5() var result = await context.Brands.OrderBy(t => t.Name).ThenBy(t => t.Id).ToPageAsync(pagingArgs); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add( new @@ -729,7 +775,11 @@ public async Task Paging_First_5_Before_Id_96() var result = await context.Brands.OrderBy(t => t.Name).ThenBy(t => t.Id).ToPageAsync(pagingArgs); // Assert - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add( new @@ -869,7 +919,11 @@ public async Task Map_Page_To_Connection_With_Dto() // Assert var operationResult = result.ExpectOperationResult(); - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(operationResult) .MatchMarkdownAsync(); @@ -914,7 +968,11 @@ public async Task Map_Page_To_Connection_With_Dto_2() // Assert var operationResult = result.ExpectOperationResult(); - await Snapshot.Create() + await Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddQueries(queries) .Add(operationResult) .MatchMarkdownAsync(); @@ -967,11 +1025,8 @@ public async Task Ensure_Nullable_Connections_Dont_Throw() // Assert var operationResult = result.ExpectOperationResult(); -#if NET8_0 - await Snapshot.Create() -#else - await Snapshot.Create("NET9_0") -#endif + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(queries) .Add(operationResult, "Result") .MatchMarkdownAsync(); @@ -1026,11 +1081,8 @@ public async Task Ensure_Nullable_Connections_Dont_Throw_2() // Assert var operationResult = result.ExpectOperationResult(); -#if NET8_0 - await Snapshot.Create() -#else - await Snapshot.Create("NET9_0") -#endif + await Snapshot + .Create(postFix: TestEnvironment.TargetFramework) .AddQueries(queries) .Add(operationResult, "Result") .MatchMarkdownAsync(); diff --git a/src/HotChocolate/Data/test/Data.Tests/ProjectableDataLoaderTests.cs b/src/HotChocolate/Data/test/Data.Tests/ProjectableDataLoaderTests.cs index a4e2b26c796..20e048ee543 100644 --- a/src/HotChocolate/Data/test/Data.Tests/ProjectableDataLoaderTests.cs +++ b/src/HotChocolate/Data/test/Data.Tests/ProjectableDataLoaderTests.cs @@ -45,7 +45,11 @@ public async Task Brand_With_Name() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -76,7 +80,11 @@ public async Task Brand_With_Name_Selector_is_Null() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -107,7 +115,11 @@ public async Task Manual_Include_Of_Brand() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -173,7 +185,11 @@ public async Task Do_Not_Project() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -207,7 +223,11 @@ public async Task Project_And_Do_Not_Project() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -241,7 +261,11 @@ public async Task Product_With_Name_And_Brand_With_Name() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -281,7 +305,11 @@ public async Task Force_A_Branch() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -321,7 +349,11 @@ public async Task Branches_Are_Merged() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -357,7 +389,11 @@ public async Task Brand_Details_Country_Name() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -394,7 +430,11 @@ public async Task Brand_Details_Country_Name_With_Details_As_Custom_Resolver() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -426,7 +466,11 @@ public async Task Brand_Details_Requires_Brand_Name() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -458,7 +502,11 @@ public async Task Brand_Details_Requires_Brand_Name_With_Proper_Type() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -490,7 +538,11 @@ public async Task Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explic } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -523,7 +575,11 @@ public async Task Brand_Details_Requires_Brand_Name_2() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -558,7 +614,11 @@ public async Task Brand_Products_TypeName() // at the moment we do not support projections on lists // so products will be empty, and we will just select the brand.Id - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -590,7 +650,11 @@ public async Task Brand_Only_TypeName() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -626,7 +690,11 @@ ... on Brand { } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -660,7 +728,11 @@ ... on Brand { } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -692,7 +764,11 @@ public async Task Brand_With_Default_Field_Over_Node() } """); - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -723,7 +799,11 @@ public async Task Project_Key_To_Collection_Expression() await dataLoader.LoadAsync(1); // Assert - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .MatchMarkdownSnapshot(); } @@ -754,7 +834,11 @@ public async Task Project_Key_To_Collection_Expression_Integration() } """); // Assert - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .Add(result, "Result") .MatchMarkdownSnapshot(); @@ -787,7 +871,11 @@ public async Task Product_With_Nullable_Reference_Property_Set_To_Null() """); // Assert - Snapshot.Create() + Snapshot + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddSql(queries) .Add(result, "Result") .MatchMarkdownSnapshot(); diff --git a/src/HotChocolate/Data/test/Data.Tests/TestContext2/AnimalContext.cs b/src/HotChocolate/Data/test/Data.Tests/TestContext2/AnimalContext.cs index 398a0a2f29d..4f3d2909a84 100644 --- a/src/HotChocolate/Data/test/Data.Tests/TestContext2/AnimalContext.cs +++ b/src/HotChocolate/Data/test/Data.Tests/TestContext2/AnimalContext.cs @@ -6,10 +6,10 @@ namespace HotChocolate.Data.TestContext2; public class AnimalContext(string connectionString) : DbContext { - public DbSet Owners { get; set; } - public DbSet Pets { get; set; } - public DbSet Dogs { get; set; } - public DbSet Cats { get; set; } + public DbSet Owners { get; set; } = null!; + public DbSet Pets { get; set; } = null!; + public DbSet Dogs { get; set; } = null!; + public DbSet Cats { get; set; } = null!; protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder.UseNpgsql(connectionString); diff --git a/src/HotChocolate/Data/test/Data.Tests/TestContext2/FooBarContext.cs b/src/HotChocolate/Data/test/Data.Tests/TestContext2/FooBarContext.cs index 4b554bc3d1d..9f53a2b5f92 100644 --- a/src/HotChocolate/Data/test/Data.Tests/TestContext2/FooBarContext.cs +++ b/src/HotChocolate/Data/test/Data.Tests/TestContext2/FooBarContext.cs @@ -10,9 +10,9 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) optionsBuilder.UseNpgsql(connectionString); } - public DbSet Foos { get; set; } + public DbSet Foos { get; set; } = null!; - public DbSet Bars { get; set; } + public DbSet Bars { get; set; } = null!; protected override void OnModelCreating(ModelBuilder modelBuilder) { diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap new file mode 100644 index 00000000000..be38bb5dff6 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap @@ -0,0 +1,17 @@ +{ + "result": { + "Id": 1, + "Name": "Foo", + "Books": [ + { + "Id": 1, + "AuthorId": 0, + "Title": "Foo1", + "Author": null, + "Publisher": null + } + ], + "Publishers": [] + }, + "executable": "System.Linq.Enumerable+IListSkipTakeIterator`1[HotChocolate.Data.Author]" +} diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_2_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_2_NET10_0.md new file mode 100644 index 00000000000..20fbdcd1fd5 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_2_NET10_0.md @@ -0,0 +1,65 @@ +# Ensure_Nullable_Connections_Dont_Throw_2 + +## SQL 0 + +```sql +-- @p='11' +SELECT f0."Id", f0."Name", b."Id" IS NULL, b."Id", b."Description", b."SomeField1", b."SomeField2" +FROM ( + SELECT f."Id", f."BarId", f."Name" + FROM "Foos" AS f + ORDER BY f."Name", f."Id" + LIMIT @p +) AS f0 +LEFT JOIN "Bars" AS b ON f0."BarId" = b."Id" +ORDER BY f0."Name", f0."Id" +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Select(root => new Foo() {Id = root.Id, Name = root.Name, Bar = IIF((root.Bar == null), null, new Bar() {Id = root.Bar.Id, Description = IIF((root.Bar.Description == null), null, root.Bar.Description), SomeField1 = root.Bar.SomeField1, SomeField2 = IIF((root.Bar.SomeField2 == null), null, root.Bar.SomeField2)})}).Take(11) +``` + +## Result + +```json +{ + "data": { + "foos": { + "edges": [ + { + "cursor": "e31Gb28gMTox" + }, + { + "cursor": "e31Gb28gMjoy" + } + ], + "nodes": [ + { + "id": 1, + "name": "Foo 1", + "bar": null + }, + { + "id": 2, + "name": "Foo 2", + "bar": { + "id": 1, + "description": "Bar 1", + "someField1": "abc", + "someField2": null + } + } + ], + "pageInfo": { + "hasNextPage": false, + "hasPreviousPage": false, + "startCursor": "e31Gb28gMTox", + "endCursor": "e31Gb28gMjoy" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_2.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_2_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_2.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_2_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_NET10_0.md new file mode 100644 index 00000000000..343da20b2a7 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_NET10_0.md @@ -0,0 +1,63 @@ +# Ensure_Nullable_Connections_Dont_Throw + +## SQL 0 + +```sql +-- @p='11' +SELECT f0."Id", f0."Name", b."Id" IS NULL, b."Id", b."Description" +FROM ( + SELECT f."Id", f."BarId", f."Name" + FROM "Foos" AS f + ORDER BY f."Name", f."Id" + LIMIT @p +) AS f0 +LEFT JOIN "Bars" AS b ON f0."BarId" = b."Id" +ORDER BY f0."Name", f0."Id" +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Select(root => new Foo() {Id = root.Id, Name = root.Name, Bar = IIF((root.Bar == null), null, new Bar() {Id = root.Bar.Id, Description = IIF((root.Bar.Description == null), null, root.Bar.Description)})}).Take(11) +``` + +## Result + +```json +{ + "data": { + "foos": { + "edges": [ + { + "cursor": "e31Gb28gMTox" + }, + { + "cursor": "e31Gb28gMjoy" + } + ], + "nodes": [ + { + "id": 1, + "name": "Foo 1", + "bar": null + }, + { + "id": 2, + "name": "Foo 2", + "bar": { + "id": 1, + "description": "Bar 1" + } + } + ], + "pageInfo": { + "hasNextPage": false, + "hasPreviousPage": false, + "startCursor": "e31Gb28gMTox", + "endCursor": "e31Gb28gMjoy" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Ensure_Nullable_Connections_Dont_Throw_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage2_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage2_NET10_0.md new file mode 100644 index 00000000000..50414c02d33 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage2_NET10_0.md @@ -0,0 +1,77 @@ +# GetDefaultPage2 + +## SQL 0 + +```sql +-- @p='11' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11) +``` + +## Result + +```json +{ + "data": { + "brands2": { + "nodes": [ + { + "id": 1, + "name": "Brand:0" + }, + { + "id": 2, + "name": "Brand:1" + }, + { + "id": 11, + "name": "Brand:10" + }, + { + "id": 12, + "name": "Brand:11" + }, + { + "id": 13, + "name": "Brand:12" + }, + { + "id": 14, + "name": "Brand:13" + }, + { + "id": 15, + "name": "Brand:14" + }, + { + "id": 16, + "name": "Brand:15" + }, + { + "id": 17, + "name": "Brand:16" + }, + { + "id": 18, + "name": "Brand:17" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "startCursor": "e31CcmFuZFw6MDox", + "endCursor": "e31CcmFuZFw6MTc6MTg=" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_NET10_0.md new file mode 100644 index 00000000000..110da5a2f8b --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_NET10_0.md @@ -0,0 +1,77 @@ +# GetDefaultPage + +## SQL 0 + +```sql +-- @p='11' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11) +``` + +## Result + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "id": 1, + "name": "Brand:0" + }, + { + "id": 2, + "name": "Brand:1" + }, + { + "id": 11, + "name": "Brand:10" + }, + { + "id": 12, + "name": "Brand:11" + }, + { + "id": 13, + "name": "Brand:12" + }, + { + "id": 14, + "name": "Brand:13" + }, + { + "id": 15, + "name": "Brand:14" + }, + { + "id": 16, + "name": "Brand:15" + }, + { + "id": 17, + "name": "Brand:16" + }, + { + "id": 18, + "name": "Brand:17" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "startCursor": "e31CcmFuZFw6MDox", + "endCursor": "e31CcmFuZFw6MTc6MTg=" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Deep_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Deep_NET10_0.md new file mode 100644 index 00000000000..e5cd93e23dd --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Deep_NET10_0.md @@ -0,0 +1,169 @@ +# GetDefaultPage_With_Deep + +## SQL 0 + +```sql +-- @p='11' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."BrandDetails_Country_Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(x => x.BrandDetails.Country.Name).ThenBy(t => t.Id).Take(11) +``` + +## Result + +```json +{ + "data": { + "brandsDeep": { + "edges": [ + { + "cursor": "e31Db3VudHJ5MDox" + }, + { + "cursor": "e31Db3VudHJ5MToy" + }, + { + "cursor": "e31Db3VudHJ5MTA6MTE=" + }, + { + "cursor": "e31Db3VudHJ5MTE6MTI=" + }, + { + "cursor": "e31Db3VudHJ5MTI6MTM=" + }, + { + "cursor": "e31Db3VudHJ5MTM6MTQ=" + }, + { + "cursor": "e31Db3VudHJ5MTQ6MTU=" + }, + { + "cursor": "e31Db3VudHJ5MTU6MTY=" + }, + { + "cursor": "e31Db3VudHJ5MTY6MTc=" + }, + { + "cursor": "e31Db3VudHJ5MTc6MTg=" + } + ], + "nodes": [ + { + "id": 1, + "name": "Brand:0", + "displayName": "BrandDisplay0", + "brandDetails": { + "country": { + "name": "Country0" + } + } + }, + { + "id": 2, + "name": "Brand:1", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country1" + } + } + }, + { + "id": 11, + "name": "Brand:10", + "displayName": "BrandDisplay10", + "brandDetails": { + "country": { + "name": "Country10" + } + } + }, + { + "id": 12, + "name": "Brand:11", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country11" + } + } + }, + { + "id": 13, + "name": "Brand:12", + "displayName": "BrandDisplay12", + "brandDetails": { + "country": { + "name": "Country12" + } + } + }, + { + "id": 14, + "name": "Brand:13", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country13" + } + } + }, + { + "id": 15, + "name": "Brand:14", + "displayName": "BrandDisplay14", + "brandDetails": { + "country": { + "name": "Country14" + } + } + }, + { + "id": 16, + "name": "Brand:15", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country15" + } + } + }, + { + "id": 17, + "name": "Brand:16", + "displayName": "BrandDisplay16", + "brandDetails": { + "country": { + "name": "Country16" + } + } + }, + { + "id": 18, + "name": "Brand:17", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country17" + } + } + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "startCursor": "e31Db3VudHJ5MDox", + "endCursor": "e31Db3VudHJ5MTc6MTg=" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Deep_SecondPage_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Deep_SecondPage_NET10_0.md new file mode 100644 index 00000000000..e7f8f4399b3 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Deep_SecondPage_NET10_0.md @@ -0,0 +1,68 @@ +# GetDefaultPage_With_Deep_SecondPage + +## SQL 0 + +```sql +-- @value='Country1' +-- @value1='2' +-- @p='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."BrandDetails_Country_Name" > @value OR (b."BrandDetails_Country_Name" = @value AND b."Id" > @value1) +ORDER BY b."BrandDetails_Country_Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(x => x.BrandDetails.Country.Name).ThenBy(t => t.Id).Where(t => ((t.BrandDetails.Country.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) > 0) OrElse ((t.BrandDetails.Country.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.Int32]).value) > 0)))).Take(3) +``` + +## Result + +```json +{ + "data": { + "brandsDeep": { + "edges": [ + { + "cursor": "e31Db3VudHJ5MTA6MTE=" + }, + { + "cursor": "e31Db3VudHJ5MTE6MTI=" + } + ], + "nodes": [ + { + "id": 11, + "name": "Brand:10", + "displayName": "BrandDisplay10", + "brandDetails": { + "country": { + "name": "Country10" + } + } + }, + { + "id": 12, + "name": "Brand:11", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country11" + } + } + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "startCursor": "e31Db3VudHJ5MTA6MTE=", + "endCursor": "e31Db3VudHJ5MTE6MTI=" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_Fallback_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_Fallback_NET10_0.md new file mode 100644 index 00000000000..c6dbc0f6a82 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_Fallback_NET10_0.md @@ -0,0 +1,169 @@ +# GetDefaultPage_With_Nullable_Fallback + +## SQL 0 + +```sql +-- @p='11' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY COALESCE(b."DisplayName", b."Name"), b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => (t.DisplayName ?? t.Name)).ThenBy(t => t.Id).Take(11) +``` + +## Result + +```json +{ + "data": { + "brandsNullableFallback": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MToy" + }, + { + "cursor": "e31CcmFuZFw6MTE6MTI=" + }, + { + "cursor": "e31CcmFuZFw6MTM6MTQ=" + }, + { + "cursor": "e31CcmFuZFw6MTU6MTY=" + }, + { + "cursor": "e31CcmFuZFw6MTc6MTg=" + }, + { + "cursor": "e31CcmFuZFw6MTk6MjA=" + }, + { + "cursor": "e31CcmFuZFw6MjE6MjI=" + }, + { + "cursor": "e31CcmFuZFw6MjM6MjQ=" + }, + { + "cursor": "e31CcmFuZFw6MjU6MjY=" + }, + { + "cursor": "e31CcmFuZFw6Mjc6Mjg=" + } + ], + "nodes": [ + { + "id": 2, + "name": "Brand:1", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country1" + } + } + }, + { + "id": 12, + "name": "Brand:11", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country11" + } + } + }, + { + "id": 14, + "name": "Brand:13", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country13" + } + } + }, + { + "id": 16, + "name": "Brand:15", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country15" + } + } + }, + { + "id": 18, + "name": "Brand:17", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country17" + } + } + }, + { + "id": 20, + "name": "Brand:19", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country19" + } + } + }, + { + "id": 22, + "name": "Brand:21", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country21" + } + } + }, + { + "id": 24, + "name": "Brand:23", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country23" + } + } + }, + { + "id": 26, + "name": "Brand:25", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country25" + } + } + }, + { + "id": 28, + "name": "Brand:27", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country27" + } + } + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "startCursor": "e31CcmFuZFw6MToy", + "endCursor": "e31CcmFuZFw6Mjc6Mjg=" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_Fallback_SecondPage_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_Fallback_SecondPage_NET10_0.md new file mode 100644 index 00000000000..d4c015a9933 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_Fallback_SecondPage_NET10_0.md @@ -0,0 +1,68 @@ +# GetDefaultPage_With_Nullable_Fallback_SecondPage + +## SQL 0 + +```sql +-- @value='Brand:11' +-- @value1='12' +-- @p='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE COALESCE(b."DisplayName", b."Name") > @value OR (COALESCE(b."DisplayName", b."Name") = @value AND b."Id" > @value1) +ORDER BY COALESCE(b."DisplayName", b."Name"), b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => (t.DisplayName ?? t.Name)).ThenBy(t => t.Id).Where(t => (((t.DisplayName ?? t.Name).CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) > 0) OrElse (((t.DisplayName ?? t.Name).CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.Int32]).value) > 0)))).Take(3) +``` + +## Result + +```json +{ + "data": { + "brandsNullableFallback": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MTM6MTQ=" + }, + { + "cursor": "e31CcmFuZFw6MTU6MTY=" + } + ], + "nodes": [ + { + "id": 14, + "name": "Brand:13", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country13" + } + } + }, + { + "id": 16, + "name": "Brand:15", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country15" + } + } + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "startCursor": "e31CcmFuZFw6MTM6MTQ=", + "endCursor": "e31CcmFuZFw6MTU6MTY=" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_NET10_0.md new file mode 100644 index 00000000000..fe91a6a63cf --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_NET10_0.md @@ -0,0 +1,169 @@ +# GetDefaultPage_With_Nullable + +## SQL 0 + +```sql +-- @p='11' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."AlwaysNull", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(x => x.AlwaysNull).ThenBy(t => t.Id).Take(11) +``` + +## Result + +```json +{ + "data": { + "brandsNullable": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MDpcbnVsbDox" + }, + { + "cursor": "e31CcmFuZFw6MTpcbnVsbDoy" + }, + { + "cursor": "e31CcmFuZFw6MTA6XG51bGw6MTE=" + }, + { + "cursor": "e31CcmFuZFw6MTE6XG51bGw6MTI=" + }, + { + "cursor": "e31CcmFuZFw6MTI6XG51bGw6MTM=" + }, + { + "cursor": "e31CcmFuZFw6MTM6XG51bGw6MTQ=" + }, + { + "cursor": "e31CcmFuZFw6MTQ6XG51bGw6MTU=" + }, + { + "cursor": "e31CcmFuZFw6MTU6XG51bGw6MTY=" + }, + { + "cursor": "e31CcmFuZFw6MTY6XG51bGw6MTc=" + }, + { + "cursor": "e31CcmFuZFw6MTc6XG51bGw6MTg=" + } + ], + "nodes": [ + { + "id": 1, + "name": "Brand:0", + "displayName": "BrandDisplay0", + "brandDetails": { + "country": { + "name": "Country0" + } + } + }, + { + "id": 2, + "name": "Brand:1", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country1" + } + } + }, + { + "id": 11, + "name": "Brand:10", + "displayName": "BrandDisplay10", + "brandDetails": { + "country": { + "name": "Country10" + } + } + }, + { + "id": 12, + "name": "Brand:11", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country11" + } + } + }, + { + "id": 13, + "name": "Brand:12", + "displayName": "BrandDisplay12", + "brandDetails": { + "country": { + "name": "Country12" + } + } + }, + { + "id": 14, + "name": "Brand:13", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country13" + } + } + }, + { + "id": 15, + "name": "Brand:14", + "displayName": "BrandDisplay14", + "brandDetails": { + "country": { + "name": "Country14" + } + } + }, + { + "id": 16, + "name": "Brand:15", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country15" + } + } + }, + { + "id": 17, + "name": "Brand:16", + "displayName": "BrandDisplay16", + "brandDetails": { + "country": { + "name": "Country16" + } + } + }, + { + "id": 18, + "name": "Brand:17", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country17" + } + } + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "startCursor": "e31CcmFuZFw6MDpcbnVsbDox", + "endCursor": "e31CcmFuZFw6MTc6XG51bGw6MTg=" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_SecondPage_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_SecondPage_NET10_0.md new file mode 100644 index 00000000000..95dab89742c --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetDefaultPage_With_Nullable_SecondPage_NET10_0.md @@ -0,0 +1,68 @@ +# GetDefaultPage_With_Nullable_SecondPage + +## SQL 0 + +```sql +-- @value='Brand10' +-- @value4='11' +-- @p='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."AlwaysNull" > NULL) OR (b."Name" = @value AND b."AlwaysNull" IS NULL AND b."Id" > @value4) +ORDER BY b."Name", b."AlwaysNull", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(x => x.AlwaysNull).ThenBy(t => t.Id).Where(t => (((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) > 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) == 0) AndAlso (t.AlwaysNull.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) > 0))) OrElse (((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) == 0) AndAlso (t.AlwaysNull.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) == 0)) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.Int32]).value) > 0)))).Take(3) +``` + +## Result + +```json +{ + "data": { + "brandsNullable": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MTE6XG51bGw6MTI=" + }, + { + "cursor": "e31CcmFuZFw6MTI6XG51bGw6MTM=" + } + ], + "nodes": [ + { + "id": 12, + "name": "Brand:11", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country11" + } + } + }, + { + "id": 13, + "name": "Brand:12", + "displayName": "BrandDisplay12", + "brandDetails": { + "country": { + "name": "Country12" + } + } + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "startCursor": "e31CcmFuZFw6MTE6XG51bGw6MTI=", + "endCursor": "e31CcmFuZFw6MTI6XG51bGw6MTM=" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetSecondPage_With_2_Items_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetSecondPage_With_2_Items_NET10_0.md new file mode 100644 index 00000000000..ec0d501de5a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.GetSecondPage_With_2_Items_NET10_0.md @@ -0,0 +1,48 @@ +# GetSecondPage_With_2_Items + +## SQL 0 + +```sql +-- @value='Brand17' +-- @value1='18' +-- @p='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value1) +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Where(t => ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) > 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.Int32]).value) > 0)))).Take(3) +``` + +## Result + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "id": 19, + "name": "Brand:18" + }, + { + "id": 20, + "name": "Brand:19" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "startCursor": "e31CcmFuZFw6MTg6MTk=", + "endCursor": "e31CcmFuZFw6MTk6MjA=" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Map_Page_To_Connection_With_Dto_2_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Map_Page_To_Connection_With_Dto_2_NET10_0.md new file mode 100644 index 00000000000..8c4b5c57320 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Map_Page_To_Connection_With_Dto_2_NET10_0.md @@ -0,0 +1,47 @@ +# Map_Page_To_Connection_With_Dto_2 + +## SQL 0 + +```sql +-- @p='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(3) +``` + +## Result 3 + +```json +{ + "data": { + "brands": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MDox", + "displayName": "BrandDisplay0", + "node": { + "id": 1, + "name": "Brand:0" + } + }, + { + "cursor": "e31CcmFuZFw6MToy", + "displayName": null, + "node": { + "id": 2, + "name": "Brand:1" + } + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Map_Page_To_Connection_With_Dto_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Map_Page_To_Connection_With_Dto_NET10_0.md new file mode 100644 index 00000000000..3eb365fb823 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Map_Page_To_Connection_With_Dto_NET10_0.md @@ -0,0 +1,47 @@ +# Map_Page_To_Connection_With_Dto + +## SQL 0 + +```sql +-- @p='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(3) +``` + +## Result 3 + +```json +{ + "data": { + "brands": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MDox", + "displayName": "BrandDisplay0", + "node": { + "id": 1, + "name": "Brand:0" + } + }, + { + "cursor": "e31CcmFuZFw6MToy", + "displayName": null, + "node": { + "id": 2, + "name": "Brand:1" + } + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET10_0.md new file mode 100644 index 00000000000..a72855912c2 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET10_0.md @@ -0,0 +1,104 @@ +# Nested_Paging_First_2 + +## SQL 0 + +```sql +-- @p='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(3) +``` + +## SQL 1 + +```sql +-- @keys={ '2', '1' } (DbType = Object) +SELECT p1."BrandId", p3."Id", p3."AvailableStock", p3."BrandId", p3."Description", p3."ImageFileName", p3."MaxStockThreshold", p3."Name", p3."OnReorder", p3."Price", p3."RestockThreshold", p3."TypeId" +FROM ( + SELECT p."BrandId" + FROM "Products" AS p + WHERE p."BrandId" = ANY (@keys) + GROUP BY p."BrandId" +) AS p1 +LEFT JOIN ( + SELECT p2."Id", p2."AvailableStock", p2."BrandId", p2."Description", p2."ImageFileName", p2."MaxStockThreshold", p2."Name", p2."OnReorder", p2."Price", p2."RestockThreshold", p2."TypeId" + FROM ( + SELECT p0."Id", p0."AvailableStock", p0."BrandId", p0."Description", p0."ImageFileName", p0."MaxStockThreshold", p0."Name", p0."OnReorder", p0."Price", p0."RestockThreshold", p0."TypeId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Name", p0."Id") AS row + FROM "Products" AS p0 + WHERE p0."BrandId" = ANY (@keys) + ) AS p2 + WHERE p2.row <= 3 +) AS p3 ON p1."BrandId" = p3."BrandId" +ORDER BY p1."BrandId", p3."BrandId", p3."Name", p3."Id" +``` + +## Expression 1 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => value(HotChocolate.Data.IntegrationPagingHelperTests+ProductsByBrandDataLoader+<>c__DisplayClass2_0).keys.Contains(t.BrandId)).GroupBy(t => t.BrandId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderBy(t => t.Name).ThenBy(t => t.Id).Take(3).ToList()}) +``` + +## Result 5 + +```json +{ + "data": { + "brands": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MDox" + }, + { + "cursor": "e31CcmFuZFw6MToy" + } + ], + "nodes": [ + { + "products": { + "nodes": [ + { + "name": "Product 0-0" + }, + { + "name": "Product 0-1" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "startCursor": "e31Qcm9kdWN0IDAtMDox", + "endCursor": "e31Qcm9kdWN0IDAtMToy" + } + } + }, + { + "products": { + "nodes": [ + { + "name": "Product 1-0" + }, + { + "name": "Product 1-1" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "startCursor": "e31Qcm9kdWN0IDEtMDoxMDE=", + "endCursor": "e31Qcm9kdWN0IDEtMToxMDI=" + } + } + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET10_0.md new file mode 100644 index 00000000000..5e62bdccd05 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET10_0.md @@ -0,0 +1,104 @@ +# Nested_Paging_First_2_With_Projections + +## SQL 0 + +```sql +-- @p='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(3) +``` + +## SQL 1 + +```sql +-- @keys={ '2', '1' } (DbType = Object) +SELECT p1."BrandId", p3."Name", p3."BrandId", p3."Id" +FROM ( + SELECT p."BrandId" + FROM "Products" AS p + WHERE p."BrandId" = ANY (@keys) + GROUP BY p."BrandId" +) AS p1 +LEFT JOIN ( + SELECT p2."Name", p2."BrandId", p2."Id" + FROM ( + SELECT p0."Name", p0."BrandId", p0."Id", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Name", p0."Id") AS row + FROM "Products" AS p0 + WHERE p0."BrandId" = ANY (@keys) + ) AS p2 + WHERE p2.row <= 3 +) AS p3 ON p1."BrandId" = p3."BrandId" +ORDER BY p1."BrandId", p3."BrandId", p3."Name", p3."Id" +``` + +## Expression 1 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => value(HotChocolate.Data.IntegrationPagingHelperTests+ProductsByBrandDataLoader+<>c__DisplayClass2_0).keys.Contains(t.BrandId)).Select(root => new Product() {Name = root.Name, BrandId = root.BrandId, Id = root.Id}).GroupBy(t => t.BrandId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderBy(t => t.Name).ThenBy(t => t.Id).Take(3).ToList()}) +``` + +## Result + +```json +{ + "data": { + "brands": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MDox" + }, + { + "cursor": "e31CcmFuZFw6MToy" + } + ], + "nodes": [ + { + "products": { + "nodes": [ + { + "name": "Product 0-0" + }, + { + "name": "Product 0-1" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "startCursor": "e31Qcm9kdWN0IDAtMDox", + "endCursor": "e31Qcm9kdWN0IDAtMToy" + } + } + }, + { + "products": { + "nodes": [ + { + "name": "Product 1-0" + }, + { + "name": "Product 1-1" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "startCursor": "e31Qcm9kdWN0IDEtMDoxMDE=", + "endCursor": "e31Qcm9kdWN0IDEtMToxMDI=" + } + } + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET8_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET8_0.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Empty_PagingArgs_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Empty_PagingArgs_NET10_0.md new file mode 100644 index 00000000000..6aca9b3a700 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Empty_PagingArgs_NET10_0.md @@ -0,0 +1,158 @@ +# Paging_Empty_PagingArgs + +## SQL 0 + +```sql +-- @p='11' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": false, + "First": 1, + "FirstCursor": "e31CcmFuZFw6MDox", + "Last": 18, + "LastCursor": "e31CcmFuZFw6MTc6MTg=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 1, + "Name": "Brand:0", + "DisplayName": "BrandDisplay0", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country0" + } + } + }, + { + "Id": 2, + "Name": "Brand:1", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country1" + } + } + }, + { + "Id": 11, + "Name": "Brand:10", + "DisplayName": "BrandDisplay10", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country10" + } + } + }, + { + "Id": 12, + "Name": "Brand:11", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country11" + } + } + }, + { + "Id": 13, + "Name": "Brand:12", + "DisplayName": "BrandDisplay12", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country12" + } + } + }, + { + "Id": 14, + "Name": "Brand:13", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country13" + } + } + }, + { + "Id": 15, + "Name": "Brand:14", + "DisplayName": "BrandDisplay14", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country14" + } + } + }, + { + "Id": 16, + "Name": "Brand:15", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country15" + } + } + }, + { + "Id": 17, + "Name": "Brand:16", + "DisplayName": "BrandDisplay16", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country16" + } + } + }, + { + "Id": 18, + "Name": "Brand:17", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country17" + } + } + } +] +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_After_Id_13_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_After_Id_13_NET10_0.md new file mode 100644 index 00000000000..0f175695fd2 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_After_Id_13_NET10_0.md @@ -0,0 +1,101 @@ +# Paging_First_5_After_Id_13 + +## SQL 0 + +```sql +-- @value='Brand12' +-- @value1='13' +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value1) +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Where(t => ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) > 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.Int32]).value) > 0)))).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": true, + "First": 14, + "FirstCursor": "e31CcmFuZFw6MTM6MTQ=", + "Last": 18, + "LastCursor": "e31CcmFuZFw6MTc6MTg=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 14, + "Name": "Brand:13", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country13" + } + } + }, + { + "Id": 15, + "Name": "Brand:14", + "DisplayName": "BrandDisplay14", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country14" + } + } + }, + { + "Id": 16, + "Name": "Brand:15", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country15" + } + } + }, + { + "Id": 17, + "Name": "Brand:16", + "DisplayName": "BrandDisplay16", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country16" + } + } + }, + { + "Id": 18, + "Name": "Brand:17", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country17" + } + } + } +] +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_Before_Id_96_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_Before_Id_96_NET10_0.md new file mode 100644 index 00000000000..53776b7c1c0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_Before_Id_96_NET10_0.md @@ -0,0 +1,101 @@ +# Paging_First_5_Before_Id_96 + +## SQL 0 + +```sql +-- @value='Brand95' +-- @value1='96' +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderByDescending(t => t.Name).ThenByDescending(t => t.Id).Where(t => ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) < 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass6_0`1[System.Int32]).value) < 0)))).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": true, + "First": 92, + "FirstCursor": "e31CcmFuZFw6OTE6OTI=", + "Last": 96, + "LastCursor": "e31CcmFuZFw6OTU6OTY=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 92, + "Name": "Brand:91", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country91" + } + } + }, + { + "Id": 93, + "Name": "Brand:92", + "DisplayName": "BrandDisplay92", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country92" + } + } + }, + { + "Id": 94, + "Name": "Brand:93", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country93" + } + } + }, + { + "Id": 95, + "Name": "Brand:94", + "DisplayName": "BrandDisplay94", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country94" + } + } + }, + { + "Id": 96, + "Name": "Brand:95", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country95" + } + } + } +] +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_NET10_0.md new file mode 100644 index 00000000000..7f43b5e11c7 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_First_5_NET10_0.md @@ -0,0 +1,98 @@ +# Paging_First_5 + +## SQL 0 + +```sql +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": false, + "First": 1, + "FirstCursor": "e31CcmFuZFw6MDox", + "Last": 13, + "LastCursor": "e31CcmFuZFw6MTI6MTM=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 1, + "Name": "Brand:0", + "DisplayName": "BrandDisplay0", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country0" + } + } + }, + { + "Id": 2, + "Name": "Brand:1", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country1" + } + } + }, + { + "Id": 11, + "Name": "Brand:10", + "DisplayName": "BrandDisplay10", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country10" + } + } + }, + { + "Id": 12, + "Name": "Brand:11", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country11" + } + } + }, + { + "Id": 13, + "Name": "Brand:12", + "DisplayName": "BrandDisplay12", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country12" + } + } + } +] +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Last_5_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Last_5_NET10_0.md new file mode 100644 index 00000000000..aa1c23118a7 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationPagingHelperTests.Paging_Last_5_NET10_0.md @@ -0,0 +1,98 @@ +# Paging_Last_5 + +## SQL 0 + +```sql +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderByDescending(t => t.Name).ThenByDescending(t => t.Id).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": false, + "HasPreviousPage": true, + "First": 96, + "FirstCursor": "e31CcmFuZFw6OTU6OTY=", + "Last": 100, + "LastCursor": "e31CcmFuZFw6OTk6MTAw" +} +``` + +## Result 4 + +```json +[ + { + "Id": 96, + "Name": "Brand:95", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country95" + } + } + }, + { + "Id": 97, + "Name": "Brand:96", + "DisplayName": "BrandDisplay96", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country96" + } + } + }, + { + "Id": 98, + "Name": "Brand:97", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country97" + } + } + }, + { + "Id": 99, + "Name": "Brand:98", + "DisplayName": "BrandDisplay98", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country98" + } + } + }, + { + "Id": 100, + "Name": "Brand:99", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country99" + } + } + } +] +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET10_0.md new file mode 100644 index 00000000000..744d0516d8c --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET10_0.md @@ -0,0 +1,164 @@ +# Query_Owner_Animals + +## SQL 0 + +```sql +-- @p='11' +SELECT o."Id", o."Name" +FROM "Owners" AS o +ORDER BY o."Name", o."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Select(root => new Owner() {Id = root.Id, Name = root.Name}).Take(11) +``` + +## SQL 1 + +```sql +-- @keys={ '6', '5', '4', '3', '2', ... } (DbType = Object) +SELECT s."OwnerId", s1."Id", s1."AnimalType", s1."Name", s1."OwnerId", s1."IsPurring", s1."IsBarking", s1."Id0" +FROM ( + SELECT p."OwnerId" + FROM "Owners" AS o + INNER JOIN "Pets" AS p ON o."Id" = p."OwnerId" + WHERE o."Id" = ANY (@keys) + GROUP BY p."OwnerId" +) AS s +LEFT JOIN ( + SELECT s0."Id", s0."AnimalType", s0."Name", s0."OwnerId", s0."IsPurring", s0."IsBarking", s0."Id0" + FROM ( + SELECT p0."Id", p0."AnimalType", p0."Name", p0."OwnerId", p0."IsPurring", p0."IsBarking", o0."Id" AS "Id0", ROW_NUMBER() OVER(PARTITION BY p0."OwnerId" ORDER BY p0."Name", p0."Id") AS row + FROM "Owners" AS o0 + INNER JOIN "Pets" AS p0 ON o0."Id" = p0."OwnerId" + WHERE o0."Id" = ANY (@keys) + ) AS s0 + WHERE s0.row <= 11 +) AS s1 ON s."OwnerId" = s1."OwnerId" +ORDER BY s."OwnerId", s1."OwnerId", s1."Name", s1."Id" +``` + +## Expression 1 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => value(HotChocolate.Data.InterfaceIntegrationTests+AnimalsByOwnerDataLoader+<>c__DisplayClass2_0).keys.Contains(t.Id)).SelectMany(t => t.Pets).GroupBy(t => t.OwnerId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11).ToList()}) +``` + +## Result 5 + +```json +{ + "data": { + "owners": { + "nodes": [ + { + "id": 1, + "name": "Owner 1", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 1, + "name": "Cat 1" + }, + { + "__typename": "Dog", + "id": 5, + "name": "Dog 1" + }, + { + "__typename": "Dog", + "id": 6, + "name": "Dog 2" + } + ] + } + }, + { + "id": 2, + "name": "Owner 2", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 2, + "name": "Cat 2" + }, + { + "__typename": "Dog", + "id": 7, + "name": "Dog 3" + }, + { + "__typename": "Dog", + "id": 8, + "name": "Dog 4" + } + ] + } + }, + { + "id": 3, + "name": "Owner 3", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 3, + "name": "Cat 3 (Not Pure)" + }, + { + "__typename": "Dog", + "id": 9, + "name": "Dog 5" + }, + { + "__typename": "Dog", + "id": 10, + "name": "Dog 6" + } + ] + } + }, + { + "id": 4, + "name": "Owner 4 - No Pets", + "pets": { + "nodes": [] + } + }, + { + "id": 5, + "name": "Owner 5 - Only Cat", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 4, + "name": "Only Cat" + } + ] + } + }, + { + "id": 6, + "name": "Owner 6 - Only Dog", + "pets": { + "nodes": [ + { + "__typename": "Dog", + "id": 11, + "name": "Only Dog" + } + ] + } + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET8_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET8_0.md new file mode 100644 index 00000000000..4ab695271ef --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET8_0.md @@ -0,0 +1,164 @@ +# Query_Owner_Animals + +## SQL 0 + +```sql +-- @__p_0='11' +SELECT o."Id", o."Name" +FROM "Owners" AS o +ORDER BY o."Name", o."Id" +LIMIT @__p_0 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Select(root => new Owner() {Id = root.Id, Name = root.Name}).Take(11) +``` + +## SQL 1 + +```sql +-- @__keys_0={ '6', '5', '4', '3', '2', ... } (DbType = Object) +SELECT t."OwnerId", t0."Id", t0."AnimalType", t0."Name", t0."OwnerId", t0."IsPurring", t0."IsBarking", t0."Id0" +FROM ( + SELECT p."OwnerId" + FROM "Owners" AS o + INNER JOIN "Pets" AS p ON o."Id" = p."OwnerId" + WHERE o."Id" = ANY (@__keys_0) + GROUP BY p."OwnerId" +) AS t +LEFT JOIN ( + SELECT t1."Id", t1."AnimalType", t1."Name", t1."OwnerId", t1."IsPurring", t1."IsBarking", t1."Id0" + FROM ( + SELECT p0."Id", p0."AnimalType", p0."Name", p0."OwnerId", p0."IsPurring", p0."IsBarking", o0."Id" AS "Id0", ROW_NUMBER() OVER(PARTITION BY p0."OwnerId" ORDER BY p0."Name", p0."Id") AS row + FROM "Owners" AS o0 + INNER JOIN "Pets" AS p0 ON o0."Id" = p0."OwnerId" + WHERE o0."Id" = ANY (@__keys_0) + ) AS t1 + WHERE t1.row <= 11 +) AS t0 ON t."OwnerId" = t0."OwnerId" +ORDER BY t."OwnerId", t0."OwnerId", t0."Name", t0."Id" +``` + +## Expression 1 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => value(HotChocolate.Data.InterfaceIntegrationTests+AnimalsByOwnerDataLoader+<>c__DisplayClass2_0).keys.Contains(t.Id)).SelectMany(t => t.Pets).GroupBy(t => t.OwnerId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11).ToList()}) +``` + +## Result 5 + +```json +{ + "data": { + "owners": { + "nodes": [ + { + "id": 1, + "name": "Owner 1", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 1, + "name": "Cat 1" + }, + { + "__typename": "Dog", + "id": 5, + "name": "Dog 1" + }, + { + "__typename": "Dog", + "id": 6, + "name": "Dog 2" + } + ] + } + }, + { + "id": 2, + "name": "Owner 2", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 2, + "name": "Cat 2" + }, + { + "__typename": "Dog", + "id": 7, + "name": "Dog 3" + }, + { + "__typename": "Dog", + "id": 8, + "name": "Dog 4" + } + ] + } + }, + { + "id": 3, + "name": "Owner 3", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 3, + "name": "Cat 3 (Not Pure)" + }, + { + "__typename": "Dog", + "id": 9, + "name": "Dog 5" + }, + { + "__typename": "Dog", + "id": 10, + "name": "Dog 6" + } + ] + } + }, + { + "id": 4, + "name": "Owner 4 - No Pets", + "pets": { + "nodes": [] + } + }, + { + "id": 5, + "name": "Owner 5 - Only Cat", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 4, + "name": "Only Cat" + } + ] + } + }, + { + "id": 6, + "name": "Owner 6 - Only Dog", + "pets": { + "nodes": [ + { + "__typename": "Dog", + "id": 11, + "name": "Only Dog" + } + ] + } + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET_9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET_9_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET10_0.md new file mode 100644 index 00000000000..5621f6cba4e --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET10_0.md @@ -0,0 +1,175 @@ +# Query_Owner_Animals_With_Fragments + +## SQL 0 + +```sql +-- @p='11' +SELECT o."Id", o."Name" +FROM "Owners" AS o +ORDER BY o."Name", o."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Select(root => new Owner() {Id = root.Id, Name = root.Name}).Take(11) +``` + +## SQL 1 + +```sql +-- @keys={ '6', '5', '4', '3', '2', ... } (DbType = Object) +SELECT s."OwnerId", s1."Id", s1."AnimalType", s1."Name", s1."OwnerId", s1."IsPurring", s1."IsBarking", s1."Id0" +FROM ( + SELECT p."OwnerId" + FROM "Owners" AS o + INNER JOIN "Pets" AS p ON o."Id" = p."OwnerId" + WHERE o."Id" = ANY (@keys) + GROUP BY p."OwnerId" +) AS s +LEFT JOIN ( + SELECT s0."Id", s0."AnimalType", s0."Name", s0."OwnerId", s0."IsPurring", s0."IsBarking", s0."Id0" + FROM ( + SELECT p0."Id", p0."AnimalType", p0."Name", p0."OwnerId", p0."IsPurring", p0."IsBarking", o0."Id" AS "Id0", ROW_NUMBER() OVER(PARTITION BY p0."OwnerId" ORDER BY p0."Name", p0."Id") AS row + FROM "Owners" AS o0 + INNER JOIN "Pets" AS p0 ON o0."Id" = p0."OwnerId" + WHERE o0."Id" = ANY (@keys) + ) AS s0 + WHERE s0.row <= 11 +) AS s1 ON s."OwnerId" = s1."OwnerId" +ORDER BY s."OwnerId", s1."OwnerId", s1."Name", s1."Id" +``` + +## Expression 1 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => value(HotChocolate.Data.InterfaceIntegrationTests+AnimalsByOwnerDataLoader+<>c__DisplayClass2_0).keys.Contains(t.Id)).SelectMany(t => t.Pets).GroupBy(t => t.OwnerId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11).ToList()}) +``` + +## Result 5 + +```json +{ + "data": { + "owners": { + "nodes": [ + { + "id": 1, + "name": "Owner 1", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 1, + "name": "Cat 1", + "isPurring": false + }, + { + "__typename": "Dog", + "id": 5, + "name": "Dog 1", + "isBarking": true + }, + { + "__typename": "Dog", + "id": 6, + "name": "Dog 2", + "isBarking": false + } + ] + } + }, + { + "id": 2, + "name": "Owner 2", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 2, + "name": "Cat 2", + "isPurring": false + }, + { + "__typename": "Dog", + "id": 7, + "name": "Dog 3", + "isBarking": true + }, + { + "__typename": "Dog", + "id": 8, + "name": "Dog 4", + "isBarking": false + } + ] + } + }, + { + "id": 3, + "name": "Owner 3", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 3, + "name": "Cat 3 (Not Pure)", + "isPurring": true + }, + { + "__typename": "Dog", + "id": 9, + "name": "Dog 5", + "isBarking": true + }, + { + "__typename": "Dog", + "id": 10, + "name": "Dog 6", + "isBarking": false + } + ] + } + }, + { + "id": 4, + "name": "Owner 4 - No Pets", + "pets": { + "nodes": [] + } + }, + { + "id": 5, + "name": "Owner 5 - Only Cat", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 4, + "name": "Only Cat", + "isPurring": false + } + ] + } + }, + { + "id": 6, + "name": "Owner 6 - Only Dog", + "pets": { + "nodes": [ + { + "__typename": "Dog", + "id": 11, + "name": "Only Dog", + "isBarking": true + } + ] + } + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET8_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET8_0.md new file mode 100644 index 00000000000..6521c666725 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET8_0.md @@ -0,0 +1,175 @@ +# Query_Owner_Animals_With_Fragments + +## SQL 0 + +```sql +-- @__p_0='11' +SELECT o."Id", o."Name" +FROM "Owners" AS o +ORDER BY o."Name", o."Id" +LIMIT @__p_0 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Select(root => new Owner() {Id = root.Id, Name = root.Name}).Take(11) +``` + +## SQL 1 + +```sql +-- @__keys_0={ '6', '5', '4', '3', '2', ... } (DbType = Object) +SELECT t."OwnerId", t0."Id", t0."AnimalType", t0."Name", t0."OwnerId", t0."IsPurring", t0."IsBarking", t0."Id0" +FROM ( + SELECT p."OwnerId" + FROM "Owners" AS o + INNER JOIN "Pets" AS p ON o."Id" = p."OwnerId" + WHERE o."Id" = ANY (@__keys_0) + GROUP BY p."OwnerId" +) AS t +LEFT JOIN ( + SELECT t1."Id", t1."AnimalType", t1."Name", t1."OwnerId", t1."IsPurring", t1."IsBarking", t1."Id0" + FROM ( + SELECT p0."Id", p0."AnimalType", p0."Name", p0."OwnerId", p0."IsPurring", p0."IsBarking", o0."Id" AS "Id0", ROW_NUMBER() OVER(PARTITION BY p0."OwnerId" ORDER BY p0."Name", p0."Id") AS row + FROM "Owners" AS o0 + INNER JOIN "Pets" AS p0 ON o0."Id" = p0."OwnerId" + WHERE o0."Id" = ANY (@__keys_0) + ) AS t1 + WHERE t1.row <= 11 +) AS t0 ON t."OwnerId" = t0."OwnerId" +ORDER BY t."OwnerId", t0."OwnerId", t0."Name", t0."Id" +``` + +## Expression 1 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => value(HotChocolate.Data.InterfaceIntegrationTests+AnimalsByOwnerDataLoader+<>c__DisplayClass2_0).keys.Contains(t.Id)).SelectMany(t => t.Pets).GroupBy(t => t.OwnerId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11).ToList()}) +``` + +## Result 5 + +```json +{ + "data": { + "owners": { + "nodes": [ + { + "id": 1, + "name": "Owner 1", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 1, + "name": "Cat 1", + "isPurring": false + }, + { + "__typename": "Dog", + "id": 5, + "name": "Dog 1", + "isBarking": true + }, + { + "__typename": "Dog", + "id": 6, + "name": "Dog 2", + "isBarking": false + } + ] + } + }, + { + "id": 2, + "name": "Owner 2", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 2, + "name": "Cat 2", + "isPurring": false + }, + { + "__typename": "Dog", + "id": 7, + "name": "Dog 3", + "isBarking": true + }, + { + "__typename": "Dog", + "id": 8, + "name": "Dog 4", + "isBarking": false + } + ] + } + }, + { + "id": 3, + "name": "Owner 3", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 3, + "name": "Cat 3 (Not Pure)", + "isPurring": true + }, + { + "__typename": "Dog", + "id": 9, + "name": "Dog 5", + "isBarking": true + }, + { + "__typename": "Dog", + "id": 10, + "name": "Dog 6", + "isBarking": false + } + ] + } + }, + { + "id": 4, + "name": "Owner 4 - No Pets", + "pets": { + "nodes": [] + } + }, + { + "id": 5, + "name": "Owner 5 - Only Cat", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 4, + "name": "Only Cat", + "isPurring": false + } + ] + } + }, + { + "id": 6, + "name": "Owner 6 - Only Dog", + "pets": { + "nodes": [ + { + "__typename": "Dog", + "id": 11, + "name": "Only Dog", + "isBarking": true + } + ] + } + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET_9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET_9_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET10_0.md new file mode 100644 index 00000000000..dbd167e5c75 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET10_0.md @@ -0,0 +1,187 @@ +# Query_Owner_Animals_With_TotalCount + +## SQL 0 + +```sql +-- @p='11' +SELECT o."Id", o."Name" +FROM "Owners" AS o +ORDER BY o."Name", o."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Select(root => new Owner() {Id = root.Id, Name = root.Name}).Take(11) +``` + +## SQL 1 + +```sql +-- @keys={ '6', '5', '4', '3', '2', ... } (DbType = Object) +SELECT p."OwnerId" AS "Key", count(*)::int AS "Count" +FROM "Owners" AS o +INNER JOIN "Pets" AS p ON o."Id" = p."OwnerId" +WHERE o."Id" = ANY (@keys) +GROUP BY p."OwnerId" +``` + +## Expression 1 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => value(HotChocolate.Data.InterfaceIntegrationTests+AnimalsByOwnerWithCountDataLoader+<>c__DisplayClass2_0).keys.Contains(t.Id)).SelectMany(t => t.Pets).OrderBy(t => t.Name).ThenBy(t => t.Id).GroupBy(t => t.OwnerId).Select(g => new CountResult`1() {Key = g.Key, Count = g.Count()}) +``` + +## SQL 2 + +```sql +-- @keys={ '6', '5', '4', '3', '2', ... } (DbType = Object) +SELECT s."OwnerId", s1."Id", s1."AnimalType", s1."Name", s1."OwnerId", s1."IsPurring", s1."IsBarking", s1."Id0" +FROM ( + SELECT p."OwnerId" + FROM "Owners" AS o + INNER JOIN "Pets" AS p ON o."Id" = p."OwnerId" + WHERE o."Id" = ANY (@keys) + GROUP BY p."OwnerId" +) AS s +LEFT JOIN ( + SELECT s0."Id", s0."AnimalType", s0."Name", s0."OwnerId", s0."IsPurring", s0."IsBarking", s0."Id0" + FROM ( + SELECT p0."Id", p0."AnimalType", p0."Name", p0."OwnerId", p0."IsPurring", p0."IsBarking", o0."Id" AS "Id0", ROW_NUMBER() OVER(PARTITION BY p0."OwnerId" ORDER BY p0."Name", p0."Id") AS row + FROM "Owners" AS o0 + INNER JOIN "Pets" AS p0 ON o0."Id" = p0."OwnerId" + WHERE o0."Id" = ANY (@keys) + ) AS s0 + WHERE s0.row <= 11 +) AS s1 ON s."OwnerId" = s1."OwnerId" +ORDER BY s."OwnerId", s1."OwnerId", s1."Name", s1."Id" +``` + +## Expression 2 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => value(HotChocolate.Data.InterfaceIntegrationTests+AnimalsByOwnerWithCountDataLoader+<>c__DisplayClass2_0).keys.Contains(t.Id)).SelectMany(t => t.Pets).GroupBy(t => t.OwnerId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11).ToList()}) +``` + +## Result 7 + +```json +{ + "data": { + "owners": { + "nodes": [ + { + "id": 1, + "name": "Owner 1", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 1, + "name": "Cat 1" + }, + { + "__typename": "Dog", + "id": 5, + "name": "Dog 1" + }, + { + "__typename": "Dog", + "id": 6, + "name": "Dog 2" + } + ], + "totalCount": 3 + } + }, + { + "id": 2, + "name": "Owner 2", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 2, + "name": "Cat 2" + }, + { + "__typename": "Dog", + "id": 7, + "name": "Dog 3" + }, + { + "__typename": "Dog", + "id": 8, + "name": "Dog 4" + } + ], + "totalCount": 3 + } + }, + { + "id": 3, + "name": "Owner 3", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 3, + "name": "Cat 3 (Not Pure)" + }, + { + "__typename": "Dog", + "id": 9, + "name": "Dog 5" + }, + { + "__typename": "Dog", + "id": 10, + "name": "Dog 6" + } + ], + "totalCount": 3 + } + }, + { + "id": 4, + "name": "Owner 4 - No Pets", + "pets": { + "nodes": [], + "totalCount": 0 + } + }, + { + "id": 5, + "name": "Owner 5 - Only Cat", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 4, + "name": "Only Cat" + } + ], + "totalCount": 1 + } + }, + { + "id": 6, + "name": "Owner 6 - Only Dog", + "pets": { + "nodes": [ + { + "__typename": "Dog", + "id": 11, + "name": "Only Dog" + } + ], + "totalCount": 1 + } + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET8_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET8_0.md new file mode 100644 index 00000000000..ceda3c3111b --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET8_0.md @@ -0,0 +1,187 @@ +# Query_Owner_Animals_With_TotalCount + +## SQL 0 + +```sql +-- @__p_0='11' +SELECT o."Id", o."Name" +FROM "Owners" AS o +ORDER BY o."Name", o."Id" +LIMIT @__p_0 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Select(root => new Owner() {Id = root.Id, Name = root.Name}).Take(11) +``` + +## SQL 1 + +```sql +-- @__keys_0={ '6', '5', '4', '3', '2', ... } (DbType = Object) +SELECT p."OwnerId" AS "Key", count(*)::int AS "Count" +FROM "Owners" AS o +INNER JOIN "Pets" AS p ON o."Id" = p."OwnerId" +WHERE o."Id" = ANY (@__keys_0) +GROUP BY p."OwnerId" +``` + +## Expression 1 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => value(HotChocolate.Data.InterfaceIntegrationTests+AnimalsByOwnerWithCountDataLoader+<>c__DisplayClass2_0).keys.Contains(t.Id)).SelectMany(t => t.Pets).OrderBy(t => t.Name).ThenBy(t => t.Id).GroupBy(t => t.OwnerId).Select(g => new CountResult`1() {Key = g.Key, Count = g.Count()}) +``` + +## SQL 2 + +```sql +-- @__keys_0={ '6', '5', '4', '3', '2', ... } (DbType = Object) +SELECT t."OwnerId", t0."Id", t0."AnimalType", t0."Name", t0."OwnerId", t0."IsPurring", t0."IsBarking", t0."Id0" +FROM ( + SELECT p."OwnerId" + FROM "Owners" AS o + INNER JOIN "Pets" AS p ON o."Id" = p."OwnerId" + WHERE o."Id" = ANY (@__keys_0) + GROUP BY p."OwnerId" +) AS t +LEFT JOIN ( + SELECT t1."Id", t1."AnimalType", t1."Name", t1."OwnerId", t1."IsPurring", t1."IsBarking", t1."Id0" + FROM ( + SELECT p0."Id", p0."AnimalType", p0."Name", p0."OwnerId", p0."IsPurring", p0."IsBarking", o0."Id" AS "Id0", ROW_NUMBER() OVER(PARTITION BY p0."OwnerId" ORDER BY p0."Name", p0."Id") AS row + FROM "Owners" AS o0 + INNER JOIN "Pets" AS p0 ON o0."Id" = p0."OwnerId" + WHERE o0."Id" = ANY (@__keys_0) + ) AS t1 + WHERE t1.row <= 11 +) AS t0 ON t."OwnerId" = t0."OwnerId" +ORDER BY t."OwnerId", t0."OwnerId", t0."Name", t0."Id" +``` + +## Expression 2 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => value(HotChocolate.Data.InterfaceIntegrationTests+AnimalsByOwnerWithCountDataLoader+<>c__DisplayClass2_0).keys.Contains(t.Id)).SelectMany(t => t.Pets).GroupBy(t => t.OwnerId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11).ToList()}) +``` + +## Result 7 + +```json +{ + "data": { + "owners": { + "nodes": [ + { + "id": 1, + "name": "Owner 1", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 1, + "name": "Cat 1" + }, + { + "__typename": "Dog", + "id": 5, + "name": "Dog 1" + }, + { + "__typename": "Dog", + "id": 6, + "name": "Dog 2" + } + ], + "totalCount": 3 + } + }, + { + "id": 2, + "name": "Owner 2", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 2, + "name": "Cat 2" + }, + { + "__typename": "Dog", + "id": 7, + "name": "Dog 3" + }, + { + "__typename": "Dog", + "id": 8, + "name": "Dog 4" + } + ], + "totalCount": 3 + } + }, + { + "id": 3, + "name": "Owner 3", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 3, + "name": "Cat 3 (Not Pure)" + }, + { + "__typename": "Dog", + "id": 9, + "name": "Dog 5" + }, + { + "__typename": "Dog", + "id": 10, + "name": "Dog 6" + } + ], + "totalCount": 3 + } + }, + { + "id": 4, + "name": "Owner 4 - No Pets", + "pets": { + "nodes": [], + "totalCount": 0 + } + }, + { + "id": 5, + "name": "Owner 5 - Only Cat", + "pets": { + "nodes": [ + { + "__typename": "Cat", + "id": 4, + "name": "Only Cat" + } + ], + "totalCount": 1 + } + }, + { + "id": 6, + "name": "Owner 6 - Only Dog", + "pets": { + "nodes": [ + { + "__typename": "Dog", + "id": 11, + "name": "Only Dog" + } + ], + "totalCount": 1 + } + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET_9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET_9_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets_NET10_0.md new file mode 100644 index 00000000000..75c7b042fc4 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets_NET10_0.md @@ -0,0 +1,71 @@ +# Query_Pets + +## SQL 0 + +```sql +-- @p='11' +SELECT p."AnimalType" = 'Cat', p."Id", p."Name", p."AnimalType" = 'Dog' +FROM "Pets" AS p +ORDER BY p."Name", p."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Select(root => IIF((root Is Cat), Convert(new Cat() {Id = Convert(root, Cat).Id, Name = Convert(root, Cat).Name}, Animal), IIF((root Is Dog), Convert(new Dog() {Id = Convert(root, Dog).Id, Name = Convert(root, Dog).Name}, Animal), null))).Take(11) +``` + +## Result 3 + +```json +{ + "data": { + "pets": { + "nodes": [ + { + "id": 1, + "name": "Cat 1" + }, + { + "id": 2, + "name": "Cat 2" + }, + { + "id": 3, + "name": "Cat 3 (Not Pure)" + }, + { + "id": 5, + "name": "Dog 1" + }, + { + "id": 6, + "name": "Dog 2" + }, + { + "id": 7, + "name": "Dog 3" + }, + { + "id": 8, + "name": "Dog 4" + }, + { + "id": 9, + "name": "Dog 5" + }, + { + "id": 10, + "name": "Dog 6" + }, + { + "id": 4, + "name": "Only Cat" + } + ] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET10_0.md new file mode 100644 index 00000000000..61286b464f2 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET10_0.md @@ -0,0 +1,33 @@ +# Branches_Are_Merged + +## SQL + +```text +-- @keys={ '1', '2' } (DbType = Object) +SELECT p."Name", FALSE, b."Name", p."Id" +FROM "Products" AS p +INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" +WHERE p."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "a": { + "name": "Product 0-0", + "brand": { + "name": "Brand0" + } + }, + "b": { + "name": "Product 0-1", + "brand": { + "name": "Brand0" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET10_0.md new file mode 100644 index 00000000000..362043ef3ab --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET10_0.md @@ -0,0 +1,28 @@ +# Brand_Details_Country_Name + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Name", b."Details_Country_Name" AS "Name", b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandById": { + "name": "Brand0", + "details": { + "country": { + "name": "Country0" + } + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET10_0.md new file mode 100644 index 00000000000..ffd638ee050 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET10_0.md @@ -0,0 +1,28 @@ +# Brand_Details_Country_Name_With_Details_As_Custom_Resolver + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Name", b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandById": { + "name": "Brand0", + "details": { + "country": { + "name": "Germany" + } + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2_NET10_0.md new file mode 100644 index 00000000000..82c8801dcfb --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2_NET10_0.md @@ -0,0 +1,24 @@ +# Brand_Details_Requires_Brand_Name_2 + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Name", b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandById": { + "name": "Brand0", + "details": "Brand Name:Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET10_0.md new file mode 100644 index 00000000000..688eaac1001 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET10_0.md @@ -0,0 +1,23 @@ +# Brand_Details_Requires_Brand_Name + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Name", b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandById": { + "details": "Brand Name:Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_NET10_0.md new file mode 100644 index 00000000000..38391a5aff7 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_NET10_0.md @@ -0,0 +1,23 @@ +# Brand_Details_Requires_Brand_Name_With_Proper_Type + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Name", b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandById": { + "details": "Brand Name:Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic_NET10_0.md new file mode 100644 index 00000000000..fda93f9d44c --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic_NET10_0.md @@ -0,0 +1,23 @@ +# Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Name", b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandById": { + "details": "Brand Name:Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET10_0.md new file mode 100644 index 00000000000..af50303a033 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET10_0.md @@ -0,0 +1,23 @@ +# Brand_Only_TypeName + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandById": { + "__typename": "Brand" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET10_0.md new file mode 100644 index 00000000000..09ea3555231 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET10_0.md @@ -0,0 +1,23 @@ +# Brand_Products_TypeName + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandById": { + "products": [] + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node_NET10_0.md new file mode 100644 index 00000000000..08431d39fe1 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node_NET10_0.md @@ -0,0 +1,23 @@ +# Brand_With_Default_Field_Over_Node + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "node": { + "__typename": "Brand" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node_NET10_0.md new file mode 100644 index 00000000000..7c18c726ddb --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node_NET10_0.md @@ -0,0 +1,24 @@ +# Brand_With_Id_And_Name_Over_Node + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Id", b."Name" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "node": { + "id": "QnJhbmQ6MQ==", + "name": "Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET10_0.md new file mode 100644 index 00000000000..89e118bec2a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET10_0.md @@ -0,0 +1,23 @@ +# Brand_With_Name + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Name", b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandById": { + "name": "Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node_NET10_0.md new file mode 100644 index 00000000000..9f34333725f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node_NET10_0.md @@ -0,0 +1,23 @@ +# Brand_With_Name_Over_Node + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Name", b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "node": { + "name": "Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null_NET10_0.md new file mode 100644 index 00000000000..87d08e081a9 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null_NET10_0.md @@ -0,0 +1,23 @@ +# Brand_With_Name_Selector_is_Null + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandByIdSelectorNull": { + "name": "Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET10_0.md new file mode 100644 index 00000000000..1d29e470be9 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET10_0.md @@ -0,0 +1,23 @@ +# Do_Not_Project + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandByIdNoProjection": { + "name": "Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET10_0.md new file mode 100644 index 00000000000..de5e9fcd52e --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET10_0.md @@ -0,0 +1,38 @@ +# Force_A_Branch + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT p."Name", FALSE, b."Name", p."Id" +FROM "Products" AS p +INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" +WHERE p."Id" = ANY (@keys) +-- @keys={ '1' } (DbType = Object) +SELECT p."Id", FALSE, b."Id" +FROM "Products" AS p +INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" +WHERE p."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "a": { + "name": "Product 0-0", + "brand": { + "name": "Brand0" + } + }, + "b": { + "id": 1, + "brand": { + "id": 1 + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET10_0.md new file mode 100644 index 00000000000..a9e4f509611 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET10_0.md @@ -0,0 +1,24 @@ +# Manual_Include_Of_Brand + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT p."Name", b."Id", b."DisplayName", b."Name", b."Details_Country_Name", p."Id" +FROM "Products" AS p +INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" +WHERE p."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "productByIdWithBrand": { + "name": "Product 0-0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET10_0.md new file mode 100644 index 00000000000..893a8280745 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET10_0.md @@ -0,0 +1,27 @@ +# Product_With_Name_And_Brand_With_Name + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT p."Name", FALSE, b."Name", p."Id" +FROM "Products" AS p +INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" +WHERE p."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "productById": { + "name": "Product 0-0", + "brand": { + "name": "Brand0" + } + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null_NET10_0.md new file mode 100644 index 00000000000..5faabe1dd41 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null_NET10_0.md @@ -0,0 +1,24 @@ +# Product_With_Nullable_Reference_Property_Set_To_Null + +## SQL + +```text +-- @id='1' +SELECT p."Name" +FROM "Products" AS p +WHERE p."Id" = @id +``` + +## Result + +```json +{ + "data": { + "productById": { + "name": "Product 0-0", + "type": null + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET10_0.md new file mode 100644 index 00000000000..dfa81c4fa2e --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET10_0.md @@ -0,0 +1,30 @@ +# Project_And_Do_Not_Project + +## SQL + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +-- @keys={ '1' } (DbType = Object) +SELECT b."Name", b."Id" +FROM "Brands" AS b +WHERE b."Id" = ANY (@keys) +``` + +## Result + +```json +{ + "data": { + "brandByIdNoProjection": { + "name": "Brand0" + }, + "brandById": { + "name": "Brand0" + } + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration_NET10_0.md new file mode 100644 index 00000000000..f738f8cf7b0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration_NET10_0.md @@ -0,0 +1,632 @@ +# Project_Key_To_Collection_Expression_Integration + +## SQL + +```text +-- @keys={ '2', '1' } (DbType = Object) +SELECT b."Id", p."Name", p."Id" +FROM "Brands" AS b +LEFT JOIN "Products" AS p ON b."Id" = p."BrandId" +WHERE b."Id" = ANY (@keys) +ORDER BY b."Id" +``` + +## Result + +```json +{ + "data": { + "brandById": [ + { + "products": [ + { + "name": "Product 0-0" + }, + { + "name": "Product 0-1" + }, + { + "name": "Product 0-2" + }, + { + "name": "Product 0-3" + }, + { + "name": "Product 0-4" + }, + { + "name": "Product 0-5" + }, + { + "name": "Product 0-6" + }, + { + "name": "Product 0-7" + }, + { + "name": "Product 0-8" + }, + { + "name": "Product 0-9" + }, + { + "name": "Product 0-10" + }, + { + "name": "Product 0-11" + }, + { + "name": "Product 0-12" + }, + { + "name": "Product 0-13" + }, + { + "name": "Product 0-14" + }, + { + "name": "Product 0-15" + }, + { + "name": "Product 0-16" + }, + { + "name": "Product 0-17" + }, + { + "name": "Product 0-18" + }, + { + "name": "Product 0-19" + }, + { + "name": "Product 0-20" + }, + { + "name": "Product 0-21" + }, + { + "name": "Product 0-22" + }, + { + "name": "Product 0-23" + }, + { + "name": "Product 0-24" + }, + { + "name": "Product 0-25" + }, + { + "name": "Product 0-26" + }, + { + "name": "Product 0-27" + }, + { + "name": "Product 0-28" + }, + { + "name": "Product 0-29" + }, + { + "name": "Product 0-30" + }, + { + "name": "Product 0-31" + }, + { + "name": "Product 0-32" + }, + { + "name": "Product 0-33" + }, + { + "name": "Product 0-34" + }, + { + "name": "Product 0-35" + }, + { + "name": "Product 0-36" + }, + { + "name": "Product 0-37" + }, + { + "name": "Product 0-38" + }, + { + "name": "Product 0-39" + }, + { + "name": "Product 0-40" + }, + { + "name": "Product 0-41" + }, + { + "name": "Product 0-42" + }, + { + "name": "Product 0-43" + }, + { + "name": "Product 0-44" + }, + { + "name": "Product 0-45" + }, + { + "name": "Product 0-46" + }, + { + "name": "Product 0-47" + }, + { + "name": "Product 0-48" + }, + { + "name": "Product 0-49" + }, + { + "name": "Product 0-50" + }, + { + "name": "Product 0-51" + }, + { + "name": "Product 0-52" + }, + { + "name": "Product 0-53" + }, + { + "name": "Product 0-54" + }, + { + "name": "Product 0-55" + }, + { + "name": "Product 0-56" + }, + { + "name": "Product 0-57" + }, + { + "name": "Product 0-58" + }, + { + "name": "Product 0-59" + }, + { + "name": "Product 0-60" + }, + { + "name": "Product 0-61" + }, + { + "name": "Product 0-62" + }, + { + "name": "Product 0-63" + }, + { + "name": "Product 0-64" + }, + { + "name": "Product 0-65" + }, + { + "name": "Product 0-66" + }, + { + "name": "Product 0-67" + }, + { + "name": "Product 0-68" + }, + { + "name": "Product 0-69" + }, + { + "name": "Product 0-70" + }, + { + "name": "Product 0-71" + }, + { + "name": "Product 0-72" + }, + { + "name": "Product 0-73" + }, + { + "name": "Product 0-74" + }, + { + "name": "Product 0-75" + }, + { + "name": "Product 0-76" + }, + { + "name": "Product 0-77" + }, + { + "name": "Product 0-78" + }, + { + "name": "Product 0-79" + }, + { + "name": "Product 0-80" + }, + { + "name": "Product 0-81" + }, + { + "name": "Product 0-82" + }, + { + "name": "Product 0-83" + }, + { + "name": "Product 0-84" + }, + { + "name": "Product 0-85" + }, + { + "name": "Product 0-86" + }, + { + "name": "Product 0-87" + }, + { + "name": "Product 0-88" + }, + { + "name": "Product 0-89" + }, + { + "name": "Product 0-90" + }, + { + "name": "Product 0-91" + }, + { + "name": "Product 0-92" + }, + { + "name": "Product 0-93" + }, + { + "name": "Product 0-94" + }, + { + "name": "Product 0-95" + }, + { + "name": "Product 0-96" + }, + { + "name": "Product 0-97" + }, + { + "name": "Product 0-98" + }, + { + "name": "Product 0-99" + } + ] + }, + { + "products": [ + { + "name": "Product 1-0" + }, + { + "name": "Product 1-1" + }, + { + "name": "Product 1-2" + }, + { + "name": "Product 1-3" + }, + { + "name": "Product 1-4" + }, + { + "name": "Product 1-5" + }, + { + "name": "Product 1-6" + }, + { + "name": "Product 1-7" + }, + { + "name": "Product 1-8" + }, + { + "name": "Product 1-9" + }, + { + "name": "Product 1-10" + }, + { + "name": "Product 1-11" + }, + { + "name": "Product 1-12" + }, + { + "name": "Product 1-13" + }, + { + "name": "Product 1-14" + }, + { + "name": "Product 1-15" + }, + { + "name": "Product 1-16" + }, + { + "name": "Product 1-17" + }, + { + "name": "Product 1-18" + }, + { + "name": "Product 1-19" + }, + { + "name": "Product 1-20" + }, + { + "name": "Product 1-21" + }, + { + "name": "Product 1-22" + }, + { + "name": "Product 1-23" + }, + { + "name": "Product 1-24" + }, + { + "name": "Product 1-25" + }, + { + "name": "Product 1-26" + }, + { + "name": "Product 1-27" + }, + { + "name": "Product 1-28" + }, + { + "name": "Product 1-29" + }, + { + "name": "Product 1-30" + }, + { + "name": "Product 1-31" + }, + { + "name": "Product 1-32" + }, + { + "name": "Product 1-33" + }, + { + "name": "Product 1-34" + }, + { + "name": "Product 1-35" + }, + { + "name": "Product 1-36" + }, + { + "name": "Product 1-37" + }, + { + "name": "Product 1-38" + }, + { + "name": "Product 1-39" + }, + { + "name": "Product 1-40" + }, + { + "name": "Product 1-41" + }, + { + "name": "Product 1-42" + }, + { + "name": "Product 1-43" + }, + { + "name": "Product 1-44" + }, + { + "name": "Product 1-45" + }, + { + "name": "Product 1-46" + }, + { + "name": "Product 1-47" + }, + { + "name": "Product 1-48" + }, + { + "name": "Product 1-49" + }, + { + "name": "Product 1-50" + }, + { + "name": "Product 1-51" + }, + { + "name": "Product 1-52" + }, + { + "name": "Product 1-53" + }, + { + "name": "Product 1-54" + }, + { + "name": "Product 1-55" + }, + { + "name": "Product 1-56" + }, + { + "name": "Product 1-57" + }, + { + "name": "Product 1-58" + }, + { + "name": "Product 1-59" + }, + { + "name": "Product 1-60" + }, + { + "name": "Product 1-61" + }, + { + "name": "Product 1-62" + }, + { + "name": "Product 1-63" + }, + { + "name": "Product 1-64" + }, + { + "name": "Product 1-65" + }, + { + "name": "Product 1-66" + }, + { + "name": "Product 1-67" + }, + { + "name": "Product 1-68" + }, + { + "name": "Product 1-69" + }, + { + "name": "Product 1-70" + }, + { + "name": "Product 1-71" + }, + { + "name": "Product 1-72" + }, + { + "name": "Product 1-73" + }, + { + "name": "Product 1-74" + }, + { + "name": "Product 1-75" + }, + { + "name": "Product 1-76" + }, + { + "name": "Product 1-77" + }, + { + "name": "Product 1-78" + }, + { + "name": "Product 1-79" + }, + { + "name": "Product 1-80" + }, + { + "name": "Product 1-81" + }, + { + "name": "Product 1-82" + }, + { + "name": "Product 1-83" + }, + { + "name": "Product 1-84" + }, + { + "name": "Product 1-85" + }, + { + "name": "Product 1-86" + }, + { + "name": "Product 1-87" + }, + { + "name": "Product 1-88" + }, + { + "name": "Product 1-89" + }, + { + "name": "Product 1-90" + }, + { + "name": "Product 1-91" + }, + { + "name": "Product 1-92" + }, + { + "name": "Product 1-93" + }, + { + "name": "Product 1-94" + }, + { + "name": "Product 1-95" + }, + { + "name": "Product 1-96" + }, + { + "name": "Product 1-97" + }, + { + "name": "Product 1-98" + }, + { + "name": "Product 1-99" + } + ] + } + ] + } +} +``` + diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_NET10_0.md new file mode 100644 index 00000000000..8ebf3d941ea --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_NET10_0.md @@ -0,0 +1,10 @@ +# Project_Key_To_Collection_Expression + +```text +-- @keys={ '1' } (DbType = Object) +SELECT b."Id", p."Name", p."Id" +FROM "Brands" AS b +LEFT JOIN "Products" AS p ON b."Id" = p."BrandId" +WHERE b."Id" = ANY (@keys) +ORDER BY b."Id" +``` diff --git a/src/HotChocolate/Language/src/Directory.Build.props b/src/HotChocolate/Language/src/Directory.Build.props index e1c12c45a4a..86473157e7d 100644 --- a/src/HotChocolate/Language/src/Directory.Build.props +++ b/src/HotChocolate/Language/src/Directory.Build.props @@ -6,7 +6,7 @@ $(ExtendedTargetFrameworks) - + true diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorContainsTests.cs b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorContainsTests.cs index 28256bef7c3..fd8c3c37f1b 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorContainsTests.cs +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorContainsTests.cs @@ -85,7 +85,10 @@ public async Task Create_Contains_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "1") .AddResult(res2, "2") .MatchAsync(); @@ -138,7 +141,10 @@ public async Task Create_NotContains_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "2") .AddResult(res2, "1") .MatchAsync(); diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorDistanceTests.cs b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorDistanceTests.cs index b895a2bd373..a2e7b1c5412 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorDistanceTests.cs +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorDistanceTests.cs @@ -90,7 +90,10 @@ public async Task Create_Distance_Expression() // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "2") .AddResult(res2, "1") .MatchAsync(); diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorIntersectTests.cs b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorIntersectTests.cs index 759dde2d64c..f0eecaa1c8c 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorIntersectTests.cs +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorIntersectTests.cs @@ -103,7 +103,10 @@ [10 10] // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "true") .AddResult(res2, "false") .MatchAsync(); diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorOverlapsTests.cs b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorOverlapsTests.cs index 58705d98c2c..315ceaef0ac 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorOverlapsTests.cs +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorOverlapsTests.cs @@ -108,7 +108,10 @@ [150 150] // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "true") .AddResult(res2, "false") .MatchAsync(); diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorTouchesTests.cs b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorTouchesTests.cs index fe9d9ebe8ff..435e79e0523 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorTouchesTests.cs +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorTouchesTests.cs @@ -103,7 +103,10 @@ [240 80] // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "true") .AddResult(res2, "false") .MatchAsync(); diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorWithinTests.cs b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorWithinTests.cs index c567118fc0a..c49206bed4c 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorWithinTests.cs +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorWithinTests.cs @@ -102,7 +102,10 @@ [20 20] // assert await Snapshot - .Create() + .Create( + postFix: TestEnvironment.TargetFramework == "NET10_0" + ? TestEnvironment.TargetFramework + : null) .AddResult(res1, "true") .AddResult(res2, "false") .MatchAsync(); diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_Contains_Expression_NET10_0.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_Contains_Expression_NET10_0.snap new file mode 100644 index 00000000000..088f25c5c97 --- /dev/null +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_Contains_Expression_NET10_0.snap @@ -0,0 +1,41 @@ +1 Result: +--------------- +{ + "data": { + "root": [ + { + "id": 1 + } + ] + } +} +--------------- + +1 SQL: +--------------- +-- @p='POINT (1 1)' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE ST_Contains(d."Bar", @p) +--------------- + +2 Result: +--------------- +{ + "data": { + "root": [ + { + "id": 2 + } + ] + } +} +--------------- + +2 SQL: +--------------- +-- @p='POINT (-1 -1)' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE ST_Contains(d."Bar", @p) +--------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_NotContains_Expression_NET10_0.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_NotContains_Expression_NET10_0.snap new file mode 100644 index 00000000000..1eafdbe7f68 --- /dev/null +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_NotContains_Expression_NET10_0.snap @@ -0,0 +1,41 @@ +2 Result: +--------------- +{ + "data": { + "root": [ + { + "id": 2 + } + ] + } +} +--------------- + +2 SQL: +--------------- +-- @p='POINT (1 1)' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE NOT (ST_Contains(d."Bar", @p)) +--------------- + +1 Result: +--------------- +{ + "data": { + "root": [ + { + "id": 1 + } + ] + } +} +--------------- + +1 SQL: +--------------- +-- @p='POINT (-1 -1)' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE NOT (ST_Contains(d."Bar", @p)) +--------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorDistanceTests.Create_Distance_Expression_NET10_0.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorDistanceTests.Create_Distance_Expression_NET10_0.snap new file mode 100644 index 00000000000..9eeb94a271d --- /dev/null +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorDistanceTests.Create_Distance_Expression_NET10_0.snap @@ -0,0 +1,43 @@ +2 Result: +--------------- +{ + "data": { + "root": [ + { + "id": 2 + } + ] + } +} +--------------- + +2 SQL: +--------------- +-- @p='POINT (1 1)' (DbType = Object) +-- @p0='1' +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE ST_Distance(d."Bar", @p) > @p0 +--------------- + +1 Result: +--------------- +{ + "data": { + "root": [ + { + "id": 1 + } + ] + } +} +--------------- + +1 SQL: +--------------- +-- @p='POINT (-1 -1)' (DbType = Object) +-- @p0='1' +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE ST_Distance(d."Bar", @p) > @p0 +--------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorIntersectsTests.Create_Intersects_Query_NET10_0.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorIntersectsTests.Create_Intersects_Query_NET10_0.snap new file mode 100644 index 00000000000..76c3ff6c623 --- /dev/null +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorIntersectsTests.Create_Intersects_Query_NET10_0.snap @@ -0,0 +1,41 @@ +true Result: +--------------- +{ + "data": { + "root": [ + { + "id": 1 + } + ] + } +} +--------------- + +true SQL: +--------------- +-- @p='POLYGON ((10 10, 10 90, 90 90, 90 10, 10 10))' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE ST_Intersects(d."Bar", @p) +--------------- + +false Result: +--------------- +{ + "data": { + "root": [ + { + "id": 2 + } + ] + } +} +--------------- + +false SQL: +--------------- +-- @p='POLYGON ((10 10, 10 90, 90 90, 90 10, 10 10))' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE NOT (ST_Intersects(d."Bar", @p)) +--------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorOverlapsTests.Create_Overlaps_Query_NET10_0.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorOverlapsTests.Create_Overlaps_Query_NET10_0.snap new file mode 100644 index 00000000000..a9728871964 --- /dev/null +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorOverlapsTests.Create_Overlaps_Query_NET10_0.snap @@ -0,0 +1,41 @@ +true Result: +--------------- +{ + "data": { + "root": [ + { + "id": 1 + } + ] + } +} +--------------- + +true SQL: +--------------- +-- @p='POLYGON ((150 150, 270 150, 330 150, 250 70, 190 70, 70 70, 150 150))' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE ST_Overlaps(d."Bar", @p) +--------------- + +false Result: +--------------- +{ + "data": { + "root": [ + { + "id": 2 + } + ] + } +} +--------------- + +false SQL: +--------------- +-- @p='POLYGON ((150 150, 270 150, 330 150, 250 70, 190 70, 70 70, 150 150))' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE NOT (ST_Overlaps(d."Bar", @p)) +--------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorTouchesTests.Create_Touches_Query_NET10_0.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorTouchesTests.Create_Touches_Query_NET10_0.snap new file mode 100644 index 00000000000..00e46a7c3ac --- /dev/null +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorTouchesTests.Create_Touches_Query_NET10_0.snap @@ -0,0 +1,41 @@ +true Result: +--------------- +{ + "data": { + "root": [ + { + "id": 1 + } + ] + } +} +--------------- + +true SQL: +--------------- +-- @p='POLYGON ((240 80, 140 120, 180 240, 280 200, 240 80))' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE ST_Touches(d."Bar", @p) +--------------- + +false Result: +--------------- +{ + "data": { + "root": [ + { + "id": 2 + } + ] + } +} +--------------- + +false SQL: +--------------- +-- @p='POLYGON ((240 80, 140 120, 180 240, 280 200, 240 80))' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE NOT (ST_Touches(d."Bar", @p)) +--------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorWithinTests.Create_Within_Query_NET10_0.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorWithinTests.Create_Within_Query_NET10_0.snap new file mode 100644 index 00000000000..019b3a55e73 --- /dev/null +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorWithinTests.Create_Within_Query_NET10_0.snap @@ -0,0 +1,41 @@ +true Result: +--------------- +{ + "data": { + "root": [ + { + "id": 1 + } + ] + } +} +--------------- + +true SQL: +--------------- +-- @p='POLYGON ((20 20, 140 20, 120 100, 20 100, 20 20))' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE ST_Within(d."Bar", @p) +--------------- + +false Result: +--------------- +{ + "data": { + "root": [ + { + "id": 2 + } + ] + } +} +--------------- + +false SQL: +--------------- +-- @p='POLYGON ((20 20, 140 20, 120 100, 20 100, 20 20))' (DbType = Object) +SELECT d."Id", d."Bar" +FROM "Data" AS d +WHERE NOT (ST_Within(d."Bar", @p)) +--------------- diff --git a/src/StrawberryShake/Client/src/Transport.WebSockets/StrawberryShake.Transport.WebSockets.csproj b/src/StrawberryShake/Client/src/Transport.WebSockets/StrawberryShake.Transport.WebSockets.csproj index 54b803fea39..3d85a9e9c96 100644 --- a/src/StrawberryShake/Client/src/Transport.WebSockets/StrawberryShake.Transport.WebSockets.csproj +++ b/src/StrawberryShake/Client/src/Transport.WebSockets/StrawberryShake.Transport.WebSockets.csproj @@ -13,6 +13,9 @@ + + + diff --git a/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj b/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj index 6132364ae63..0941879c2f9 100644 --- a/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj +++ b/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj @@ -26,6 +26,7 @@ + diff --git a/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets b/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets index b705179f8e8..41000fd47c5 100644 --- a/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets +++ b/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets @@ -41,16 +41,18 @@ 8 9 + 10 + Text="The Strawberry Shake code generation requires .NET SDK 8, 9, or 10 to work." + Condition="'$(DotNetMajor)' != '8' AND '$(DotNetMajor)' != '9' AND '$(DotNetMajor)' != '10'" /> $(MSBuildProjectDirectory)\$(GraphQLPersistedOperationOutput.TrimEnd('/').TrimEnd('\')) $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net8", "dotnet-graphql.dll")) $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net9", "dotnet-graphql.dll")) + $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net10", "dotnet-graphql.dll")) diff --git a/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj b/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj index 36e6a1b174e..a4174320ff2 100644 --- a/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj +++ b/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj @@ -25,6 +25,7 @@ + diff --git a/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj b/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj index d2ed0950edc..2367238ba50 100644 --- a/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj +++ b/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj @@ -25,6 +25,7 @@ + diff --git a/templates/azure-function/.template.config/template.json b/templates/azure-function/.template.config/template.json index 640bf4d2f4b..2dba1886901 100644 --- a/templates/azure-function/.template.config/template.json +++ b/templates/azure-function/.template.config/template.json @@ -26,6 +26,10 @@ { "choice": "net9.0", "description": "Target .NET 9" + }, + { + "choice": "net10.0", + "description": "Target .NET 10" } ], "replaces": "net8.0", diff --git a/templates/gateway-aspire/.template.config/template.json b/templates/gateway-aspire/.template.config/template.json index b5b420074be..5a1ceaaae3c 100644 --- a/templates/gateway-aspire/.template.config/template.json +++ b/templates/gateway-aspire/.template.config/template.json @@ -26,6 +26,10 @@ { "choice": "net9.0", "description": "Target .NET 9" + }, + { + "choice": "net10.0", + "description": "Target .NET 10" } ], "replaces": "net8.0", diff --git a/templates/gateway-managed/.template.config/template.json b/templates/gateway-managed/.template.config/template.json index c1b186013e7..7d438440e90 100644 --- a/templates/gateway-managed/.template.config/template.json +++ b/templates/gateway-managed/.template.config/template.json @@ -26,6 +26,10 @@ { "choice": "net9.0", "description": "Target .NET 9" + }, + { + "choice": "net10.0", + "description": "Target .NET 10" } ], "replaces": "net8.0", diff --git a/templates/gateway/.template.config/template.json b/templates/gateway/.template.config/template.json index f89792d844f..35c968d3d86 100644 --- a/templates/gateway/.template.config/template.json +++ b/templates/gateway/.template.config/template.json @@ -26,6 +26,10 @@ { "choice": "net9.0", "description": "Target .NET 9" + }, + { + "choice": "net10.0", + "description": "Target .NET 10" } ], "replaces": "net8.0", diff --git a/templates/server/.template.config/template.json b/templates/server/.template.config/template.json index 9e367e66592..1d052edb373 100644 --- a/templates/server/.template.config/template.json +++ b/templates/server/.template.config/template.json @@ -26,6 +26,10 @@ { "choice": "net9.0", "description": "Target .NET 9" + }, + { + "choice": "net10.0", + "description": "Target .NET 10" } ], "replaces": "net8.0",