-
-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD]: Addition of delete many #615
Comments
@billy1624 can you please assign this to me? |
Assigned! :P |
Hey @AbhijithGanesh, Rough idea is that we need two new methods in DeleteMany, namely one & all which return single model & array of models respectively. sea-orm/src/executor/delete.rs Lines 34 to 46 in af23516
For database support RETURNING, it will use RETURNING syntax on delete statement to get the data of deleted models. |
I think this has partially been solved by 008f844 although for delete one, it's possible that we pass-through the primary key (like insert) and do a second query if backend does not support returning |
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.
The text was updated successfully, but these errors were encountered: