Skip to content

Feature/delete top statements - #32

Merged
temonk merged 2 commits into
mainfrom
feature/DeleteTopStatements
Sep 9, 2026
Merged

temonk merged 2 commits into
mainfrom
feature/DeleteTopStatements

Conversation

@temonk

@temonk temonk commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Temo Nikolaishvili added 2 commits September 9, 2026 14:14
…w version of nuget package

- Support SQL Server TOP(n) in DELETE/UPDATE via .Top(n) in Storm ORM
- Add AppendTopClause helper and update SQL generation logic
- Add integration/unit tests for TOP clause and OData filters
- Enhance SqlWhereTestEntity with DateOnly/TimeOnly properties
- Update ODataFilterStatementGenerator for DateOnly/TimeOnly (.NET 10+)
- Upgrade NuGet packages

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

DELETE Top(n) currently risks deleting detail-table rows beyond the limited master delete keyset, and one new SQL-generation test asserts the wrong DELETE TOP clause placement.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds support for honoring .Top(n) on DELETE and UPDATE statements in Storm’s SQL generation, and expands OData filter SQL generation coverage for DateOnly/TimeOnly constants. It also updates several test and analyzer package versions and bumps the shared assembly version.

Changes:

  • Apply TOP (n) clause generation to UPDATE and DELETE SQL (previously ignored for these operations).
  • Add new unit/integration tests for DELETE/UPDATE Top(n) SQL generation and for OData $filter translation involving DateOnly/TimeOnly.
  • Update package versions (test SDK, xUnit runner, EF Core in benchmarks, DomainPrimitives) and bump Storm version to 3.5.0.
File summaries
File Description
Tests/TrackingListTests/AltaSoft.Storm.TrackingListTests.csproj Updates test SDK + xUnit VS runner package versions.
Tests/TestModels/SqlWhereTestEntity.cs Adds DateOnly/TimeOnly properties to the test entity.
Tests/TestModels/Generated/AltaSoft.Storm.Generator/AltaSoft.Storm.Generator.StormGenerator/SqlWhereTestEntity.g.cs Regenerated model/controller to include the new date/time columns.
Tests/TestModels/Generated/AltaSoft.DomainPrimitives.Generator/**/UserIdTypeConverter.g.cs Generator output update (adds warning disables).
Tests/TestModels/Generated/AltaSoft.DomainPrimitives.Generator/**/UserIdJsonConverter.g.cs Generator output update (adds warning disables).
Tests/TestModels/Generated/AltaSoft.DomainPrimitives.Generator/**/UserId.g.cs Generator output update (adds warning disables + doc/formatting fixes).
Tests/TestModels/Generated/AltaSoft.DomainPrimitives.Generator/**/OpenApiHelper.g.cs Generator output update (adds warning disables).
Tests/TestModels/Generated/AltaSoft.DomainPrimitives.Generator/**/CustomerIdTypeConverter.g.cs Generator output update (adds warning disables).
Tests/TestModels/Generated/AltaSoft.DomainPrimitives.Generator/**/CustomerIdJsonConverter.g.cs Generator output update (adds warning disables).
Tests/TestModels/Generated/AltaSoft.DomainPrimitives.Generator/**/CustomerId.g.cs Generator output update (adds warning disables + doc/formatting fixes).
Tests/TestModels/Generated/AltaSoft.DomainPrimitives.Generator/**/CurrencyIdTypeConverter.g.cs Generator output update (adds warning disables).
Tests/TestModels/Generated/AltaSoft.DomainPrimitives.Generator/**/CurrencyIdJsonConverter.g.cs Generator output update (adds warning disables).
Tests/TestModels/Generated/AltaSoft.DomainPrimitives.Generator/**/CurrencyId.g.cs Generator output update (adds warning disables + doc/formatting fixes).
Tests/TestModels/AltaSoft.Storm.TestModels.csproj Bumps DomainPrimitives package references.
Tests/OrmTests/TopClauseSqlGenerationTests.cs New test verifying TOP (n) appears in generated SQL (currently has an incorrect expectation for DELETE syntax).
Tests/OrmTests/ODataFilterStatementGeneratorTests.cs New tests for OData $filter translation for DateOnly/TimeOnly.
Tests/OrmTests/DeleteTopIntegrationTests.cs New integration test validating DELETE ... Top(n) limits deleted rows per call.
Tests/OrmTests/AltaSoft.Storm.Tests.csproj Updates test SDK + xUnit VS runner package versions.
Tests/Benchmarks/AltaSoft.Storm.Benchmarks.csproj Updates EF Core + ConfigurationManager package versions.
src/SharedAssemblyInfo.props Bumps version to 3.5.0.
src/AltaSoft.Storm/StormControllerBase.update.cs Emits UPDATE TOP (n) ... when TopRows is set.
src/AltaSoft.Storm/StormControllerBase.delete.cs Emits DELETE TOP (n) FROM ... when TopRows is set.
src/AltaSoft.Storm/StormControllerBase.cs Adds shared helper AppendTopClause(int?, StringBuilder).
src/AltaSoft.Storm/Helpers/ODataWhereStatementGenerator.cs Adjusts constant handling for NET10 vs older frameworks (date/time constant conversions).
Directory.Packages.props Updates analyzer/build packages; sets Microsoft.OData.Core to 9.0.0 for net10 while keeping 8.4.4 for net8/net9.
Review details
  • Files reviewed: 14/25 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/AltaSoft.Storm/StormControllerBase.delete.cs
Comment thread Tests/OrmTests/TopClauseSqlGenerationTests.cs
@temonk
temonk merged commit e31cb0e into main Sep 9, 2026
1 check passed
@temonk
temonk deleted the feature/DeleteTopStatements branch September 9, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants