Skip to content

fix(efcore): generate YDB DELETE ON for ExecuteDelete with joins#667

Open
KirillKurdyukov wants to merge 1 commit into
mainfrom
feat/efcore-execute-delete-sql
Open

fix(efcore): generate YDB DELETE ON for ExecuteDelete with joins#667
KirillKurdyukov wants to merge 1 commit into
mainfrom
feat/efcore-execute-delete-sql

Conversation

@KirillKurdyukov

Copy link
Copy Markdown
Collaborator

Split from #666Delete only. ExecuteUpdate / UPDATE ON will follow in a separate PR.

Summary

  • Replace unsupported SQL Server-style DELETE FROM with joins with YDB DELETE ON in YdbQuerySqlGenerator.
  • Resolve primary key columns for DELETE ON from TableExpression metadata (FindPrimaryKey()), avoiding EF pushdown subqueries.
  • Add focused SQL generation tests in ExecuteDeleteSqlYdbTest and a CHANGELOG entry.

Test plan

  • dotnet test src/EFCore.Ydb/test/EntityFrameworkCore.Ydb.FunctionalTests/EntityFrameworkCore.Ydb.FunctionalTests.csproj --filter FullyQualifiedName~ExecuteDeleteSqlYdbTest -f net10.0
  • CI integration tests against local YDB

Made with Cursor

Replace unsupported DELETE FROM syntax with YDB DELETE ON, resolving PK
columns from table metadata. ExecuteUpdate changes will follow in a
separate PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter

codecov-commenter commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.14286% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.34%. Comparing base (b71789c) to head (69331bb).

Files with missing lines Patch % Lines
...ore.Ydb/src/Query/Internal/YdbQuerySqlGenerator.cs 37.14% 61 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #667      +/-   ##
==========================================
- Coverage   82.88%   82.34%   -0.55%     
==========================================
  Files         151      151              
  Lines        9389     9492     +103     
  Branches      898      913      +15     
==========================================
+ Hits         7782     7816      +34     
- Misses       1314     1377      +63     
- Partials      293      299       +6     
Flag Coverage Δ
efcore-ydb 43.01% <37.14%> (-0.08%) ⬇️
ydb-sdk 83.52% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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