delete

Function delete 

Source
pub async fn delete<'post_build>(
    executor: impl Executor<'_>,
    model: &str,
    condition: Option<&Condition<'post_build>>,
) -> Result<u64, Error>
Expand description

This method is used to delete rows from a table.

Parameter:

  • model: Name of the model to delete rows from
  • condition: Optional condition to apply.
  • transaction: Optional transaction to execute the query on.

Returns the rows affected of the delete statement. Note that this also includes relations, etc.