Function diesel::delete [] [src]

pub fn delete<T: IntoUpdateTarget>(
    source: T
) -> DeleteStatement<T::Table, T::WhereClause>

Creates a DELETE statement.

When a table is passed to delete, every row in the table will be deleted. This scope can be narrowed by calling filter on the table before it is passed in.


Deleting a single record:

let old_count = get_count();
assert_eq!(|count| count - 1), get_count());

Deleting a whole table:

assert_eq!(Ok(0), get_count());