method is a wrapper for SQL's
DELETE. In its simplest
form, it removes all of a table's records, e.g.:
leaves the table
To remove only some of the records in the table, we can add a call to
E.g. to remove all
x is greater than
points.where(points->x > 5.0f).remove();
Or we can use other querying features, as we did with
to remove the points with the three lowest
screens .jump(movies, screens->current_movie_id == movies->id) .remove();
to remove all the movies that are currently being screened.
The rule here is the same as for
update(): the query's value mapper must be identical
to, or a copy of, some table's value mapper. That lets quince know which
table to remove records from (the one whose value mapper matches the
query's), and also which records to remove (the ones whose values are
equal to one or more of the values produced by the query).
If the query generates no records, then
remove() does nothing. If you want to treat
this condition specially, you can call one of the following instead of
bool, which is true iff at least one record was removed.
no_row_exceptionif there is nothing to remove.
In all other respects
remove_existing() behave exactly like