Hoogle Search
Within LTS Haskell 22.21 (ghc-9.6.5)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
delete :: (MonadIO m, SqlBackendCanWrite backend) => SqlQuery () -> ReaderT backend m ()esqueleto Database.Esqueleto Execute an esqueleto DELETE query inside persistent's SqlPersistT monad. Note that currently there are no type checks for statements that should not appear on a DELETE query. Example of usage:
delete $ from $ \appointment -> where_ (appointment ^. AppointmentDate <. val now)
Unlike select, there is a useful way of using delete that will lead to type ambiguities. If you want to delete all rows (i.e., no where_ clause), you'll have to use a type signature:delete $ from $ \(appointment :: SqlExpr (Entity Appointment)) -> return ()
Database.Esqueleto.Experimental:
delete $ do userFeature <- from $ table @UserFeature where_ ((userFeature ^. UserFeatureFeature) notIn valList allKnownFeatureFlags)
delete :: (MonadIO m, SqlBackendCanWrite backend) => SqlQuery () -> ReaderT backend m ()esqueleto Database.Esqueleto.Experimental Execute an esqueleto DELETE query inside persistent's SqlPersistT monad. Note that currently there are no type checks for statements that should not appear on a DELETE query. Example of usage:
delete $ from $ \appointment -> where_ (appointment ^. AppointmentDate <. val now)
Unlike select, there is a useful way of using delete that will lead to type ambiguities. If you want to delete all rows (i.e., no where_ clause), you'll have to use a type signature:delete $ from $ \(appointment :: SqlExpr (Entity Appointment)) -> return ()
Database.Esqueleto.Experimental:
delete $ do userFeature <- from $ table @UserFeature where_ ((userFeature ^. UserFeatureFeature) notIn valList allKnownFeatureFlags)
delete :: (MonadIO m, SqlBackendCanWrite backend) => SqlQuery () -> ReaderT backend m ()esqueleto Database.Esqueleto.Internal.Internal Execute an esqueleto DELETE query inside persistent's SqlPersistT monad. Note that currently there are no type checks for statements that should not appear on a DELETE query. Example of usage:
delete $ from $ \appointment -> where_ (appointment ^. AppointmentDate <. val now)
Unlike select, there is a useful way of using delete that will lead to type ambiguities. If you want to delete all rows (i.e., no where_ clause), you'll have to use a type signature:delete $ from $ \(appointment :: SqlExpr (Entity Appointment)) -> return ()
Database.Esqueleto.Experimental:
delete $ do userFeature <- from $ table @UserFeature where_ ((userFeature ^. UserFeatureFeature) notIn valList allKnownFeatureFlags)
delete :: (MonadIO m, SqlBackendCanWrite backend) => SqlQuery () -> ReaderT backend m ()esqueleto Database.Esqueleto.Legacy Execute an esqueleto DELETE query inside persistent's SqlPersistT monad. Note that currently there are no type checks for statements that should not appear on a DELETE query. Example of usage:
delete $ from $ \appointment -> where_ (appointment ^. AppointmentDate <. val now)
Unlike select, there is a useful way of using delete that will lead to type ambiguities. If you want to delete all rows (i.e., no where_ clause), you'll have to use a type signature:delete $ from $ \(appointment :: SqlExpr (Entity Appointment)) -> return ()
Database.Esqueleto.Experimental:
delete $ do userFeature <- from $ table @UserFeature where_ ((userFeature ^. UserFeatureFeature) notIn valList allKnownFeatureFlags)
-
esqueleto Database.Esqueleto.Internal.Internal No documentation available.
-
esqueleto Database.Esqueleto 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 | +-----+------+-----+
deleteCount :: (MonadIO m, SqlBackendCanWrite backend) => SqlQuery () -> ReaderT backend m Int64esqueleto Database.Esqueleto Same as delete, but returns the number of rows affected.
-
esqueleto Database.Esqueleto Synonym for delete that does not clash with esqueleto's delete.
-
esqueleto Database.Esqueleto Delete all records matching the given criterion.
-
esqueleto Database.Esqueleto.Experimental 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 | +-----+------+-----+
Page 1 of many | Next