Open AbhijithGanesh opened 2 years ago
@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.
For database support RETURNING, it will use RETURNING syntax on delete statement to get the data of deleted models.
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.