SeaQL / SeaQL/sea-orm

[ADD]: Addition of delete many

Open
#615 4 comments 0 reactions 1 assignee View on GitHub

@AbhijithGanesh is already working on this.

Since Mar 16, 2022.

Dominant language
Rust
Stars
9.9k
Forks
734
Avg merge
6h 36m
Merged PRs (30d)
8

Description

Summary

Delete the row(s) on db at the same time returning the data of deleted row(s).

Motivation

Various other delete methods, this method is a good method to implement as it makes the ORM more complete.

Additional Information

Rough idea is that we need two new methods in DeleteMany, https://github.com/SeaQL/sea-orm/blob/af235168db3a675e889974a34799890350be00e4/src/executor/delete.rs#L34-L46, namely one & all which return single model & array of models respectively. For database support RETURNING, https://docs.rs/sea-orm/0.6.0/sea_orm/query/trait.ConnectionTrait.html#method.support_returning, it will use RETURNING syntax on delete statement to get the data of deleted models.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.