delete package:persistent

Delete a specific record by identifier. Does nothing if record does not exist.

Example usage

With schema-1 and dataset-1,
deleteSpj :: MonadIO m => ReaderT SqlBackend m ()
deleteSpj = delete spjId
The above query when applied on dataset-1, will produce this:
+-----+------+-----+
|id   |name  |age  |
+-----+------+-----+
|2    |Simon |41   |
+-----+------+-----+
Delete a specific record by unique key. Does nothing if no record matches.

Example usage

With schema-1 and dataset-1,
deleteBySpjName :: MonadIO m => ReaderT SqlBackend m ()
deleteBySpjName = deleteBy (UniqueUserName "SPJ")
The above query when applied on dataset-1, will produce this:
+-----+------+-----+
|id   |name  |age  |
+-----+------+-----+
|2    |Simon |41   |
+-----+------+-----+
Delete all records matching the given criterion.
Same as deleteWhere, but returns the number of rows affected.