Function diesel::query_builder::delete
[−]
[src]
pub fn delete<T: UpdateTarget>(source: T) -> DeleteStatement<T>
Creates a delete statement. Will delete the records in the given set. Because this function has a very generic name, it is not exported by default.
Examples
Deleting a single record:
let old_count = get_count(); try!(delete(users.filter(id.eq(1))).execute(&connection)); assert_eq!(old_count - 1, get_count());
Deleting a whole table:
try!(delete(users).execute(&connection)); assert_eq!(0, get_count());