Skip to content

Implement DELETE statement support in the optimizer and executor#55

Merged
ryancinsight merged 1 commit intomainfrom
implement-delete-support-9265704686498036509
Jan 11, 2026
Merged

Implement DELETE statement support in the optimizer and executor#55
ryancinsight merged 1 commit intomainfrom
implement-delete-support-9265704686498036509

Conversation

@google-labs-jules
Copy link
Contributor

@google-labs-jules google-labs-jules bot commented Jan 10, 2026

Implemented full support for the SQL DELETE statement. This involved updating the tokenizer and parser to recognize DELETE and transaction-related keywords. The execution logic was implemented in src/core/query/executor/delete_execution.rs, which handles finding rows to delete, removing them from storage and indexes, and logging undo operations for transaction rollback support. The test_physical_wal_lsn_integration test was enabled and updated to verify the end-to-end functionality.


PR created automatically by Jules for task 9265704686498036509 started by @ryancinsight

High-level PR Summary

This PR implements full support for SQL DELETE statements along with transaction control statements (BEGIN, COMMIT, ROLLBACK). The implementation spans the entire query processing pipeline from tokenization and parsing through to physical execution. A new DeleteOperator handles row deletion with proper transaction support including undo logging for rollback, index maintenance for both primary key and unique constraints, and WAL integration. The previously disabled integration test test_physical_wal_lsn_integration was re-enabled and updated to verify the complete functionality including DELETE operations within transactional contexts.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 src/core/query/sql/tokenizer.rs
2 src/core/query/sql/ast.rs
3 src/core/query/sql/parser/statement.rs
4 src/core/query/sql/translator.rs
5 src/core/query/binder/mod.rs
6 src/core/query/executor/mod.rs
7 src/core/query/executor/delete_execution.rs
8 src/core/query/executor/executor.rs
9 src/core/storage/engine/implementations/tests/file_storage_tests.rs

Need help? Join our Discord

- Enable DELETE, DROP TABLE, and Transaction (BEGIN, COMMIT, ROLLBACK) parsing in Tokenizer and Parser.
- Implement `handle_sql_delete` in QueryExecutor by delegating to a new `delete_execution` module.
- Add `delete_execution.rs` which orchestrates row selection via `SELECT` logic, executes physical deletes via `DeleteOperator`, and handles index updates and MVCC Undo Logs.
- Fix `test_physical_wal_lsn_integration` test by using public Connection API and verifying successful DELETE execution.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link

coderabbitai bot commented Jan 10, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

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

Review by RecurseML

🔍 Review performed on 8d5f078..0d95d75

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (9)

src/core/query/binder/mod.rs
src/core/query/executor/delete_execution.rs
src/core/query/executor/executor.rs
src/core/query/executor/mod.rs
src/core/query/sql/ast.rs
src/core/query/sql/parser/statement.rs
src/core/query/sql/tokenizer.rs
src/core/query/sql/translator.rs
src/core/storage/engine/implementations/tests/file_storage_tests.rs

@ryancinsight ryancinsight marked this pull request as ready for review January 11, 2026 05:41
@ryancinsight ryancinsight merged commit 1740f02 into main Jan 11, 2026
2 of 4 checks passed
@ryancinsight ryancinsight deleted the implement-delete-support-9265704686498036509 branch January 11, 2026 05:41
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.

1 participant