Skip to content

Feat: Implement Delete#56

Merged
VoidClancy merged 2 commits into
masterfrom
codegen-DELETE
Jul 22, 2026
Merged

Feat: Implement Delete#56
VoidClancy merged 2 commits into
masterfrom
codegen-DELETE

Conversation

@VoidClancy

Copy link
Copy Markdown
Owner

1- Update builders_delete template, following the same builder pattern, supporting Select and Omit

2- Update model_delete template declaring the Delete method on model delegates, the underlying executeDelete hook chain router, and runDelete database runner:

  • Simple delete with no select (defaults to returning all scalar fields)
  • Delete with scalar fields selection (returns requested scalar fields)
  • Delete with nested relations selection
  • Dialect native returning support via SupportsDeleteReturning, pre-querying both scalar fields and relations inside a transaction before deletion when relations are selected or when the dialect lacks RETURNING support
    using executeFindUnique under the hood as the full implementation is already in place, handling selection with relations and everything, separated from FindUnique to prevent hooks mixing up

3- Add DeleteQuery type and Delete extension hook signatures to the model_structs template

4- Add singular delete integration tests to delete_test.go covering basic deletion, scalar selection/omission, relation loading, 0-row sql.ErrNoRows error handling, and middleware hooks

@VoidClancy VoidClancy self-assigned this Jul 22, 2026
1- Update builders_delete template, following the same builder pattern, supporting Select and Omit

2- Update model_delete template declaring the Delete method on model delegates, the underlying executeDelete hook chain router, and runDelete database runner:
   - Simple delete with no select (defaults to returning all scalar fields)
   - Delete with scalar fields selection (returns requested scalar fields)
   - Delete with nested relations selection
   - Dialect native returning support via SupportsDeleteReturning, pre-querying both scalar fields and relations inside a transaction before deletion when relations are selected or when the dialect lacks RETURNING support
using executeFindUnique under the hood as the full implementation is already in place, handling selection with relations and everything, separated from FindUnique to prevent hooks mixing up

3- Add DeleteQuery type and Delete extension hook signatures to the model_structs template

4- Add singular delete integration tests to delete_test.go covering basic deletion, scalar selection/omission, relation loading, 0-row sql.ErrNoRows error handling, and middleware hooks
@VoidClancy
VoidClancy merged commit a9a5fdd into master Jul 22, 2026
7 checks passed
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