Safe Haskell | Safe-Infered |
---|
- class PersistStore b m => PersistQuery b m where
- update :: PersistEntity val => Key b val -> [Update val] -> b m ()
- updateWhere :: PersistEntity val => [Filter val] -> [Update val] -> b m ()
- deleteWhere :: PersistEntity val => [Filter val] -> b m ()
- selectSource :: (PersistEntity val, PersistEntityBackend val ~ b) => [Filter val] -> [SelectOpt val] -> Source (b m) (Entity val)
- selectFirst :: (PersistEntity val, PersistEntityBackend val ~ b) => [Filter val] -> [SelectOpt val] -> b m (Maybe (Entity val))
- selectKeys :: PersistEntity val => [Filter val] -> Source (b m) (Key b val)
- count :: PersistEntity val => [Filter val] -> b m Int
- newtype SqlPersist m a = SqlPersist {
- unSqlPersist :: ReaderT Connection m a
- filterClauseNoWhere :: PersistEntity val => Bool -> Connection -> [Filter val] -> Text
- getFiltsValues :: forall val. PersistEntity val => Connection -> [Filter val] -> [PersistValue]
- selectSourceConn :: (ResourceIO m, PersistEntity val, SqlPersist ~ PersistEntityBackend val) => Connection -> [Filter val] -> [SelectOpt val] -> Source m (Entity val)
- dummyFromFilts :: [Filter v] -> v
- orderClause :: PersistEntity val => Bool -> Connection -> SelectOpt val -> Text
Documentation
class PersistStore b m => PersistQuery b m whereSource
update :: PersistEntity val => Key b val -> [Update val] -> b m ()Source
Update individual fields on a specific record.
updateWhere :: PersistEntity val => [Filter val] -> [Update val] -> b m ()Source
Update individual fields on any record matching the given criterion.
deleteWhere :: PersistEntity val => [Filter val] -> b m ()Source
Delete all records matching the given criterion.
selectSource :: (PersistEntity val, PersistEntityBackend val ~ b) => [Filter val] -> [SelectOpt val] -> Source (b m) (Entity val)Source
Get all records matching the given criterion in the specified order. Returns also the identifiers.
selectFirst :: (PersistEntity val, PersistEntityBackend val ~ b) => [Filter val] -> [SelectOpt val] -> b m (Maybe (Entity val))Source
get just the first record for the criterion
selectKeys :: PersistEntity val => [Filter val] -> Source (b m) (Key b val)Source
Get the Key
s of all records matching the given criterion.
count :: PersistEntity val => [Filter val] -> b m IntSource
The total number of records fulfilling the given criterion.
ResourceIO m => PersistQuery SqlPersist m |
newtype SqlPersist m a Source
SqlPersist | |
|
MonadTrans SqlPersist | |
MonadTransControl SqlPersist | |
ResourceIO m => PersistUnique SqlPersist m | |
ResourceIO m => PersistStore SqlPersist m | |
ResourceIO m => PersistQuery SqlPersist m | |
MonadBase b m => MonadBase b (SqlPersist m) | |
MonadBaseControl b m => MonadBaseControl b (SqlPersist m) | |
Monad m => Monad (SqlPersist m) | |
Functor m => Functor (SqlPersist m) | |
MonadPlus m => MonadPlus (SqlPersist m) | |
Applicative m => Applicative (SqlPersist m) | |
ResourceThrow m => ResourceThrow (SqlPersist m) | |
MonadIO m => MonadIO (SqlPersist m) | |
PathPiece (Key SqlPersist entity) | |
(PersistEntity one, PersistEntity many, Eq (Key SqlPersist one)) => RunJoin (SelectOneMany SqlPersist one many) |
:: PersistEntity val | |
=> Bool | include table name? |
-> Connection | |
-> [Filter val] | |
-> Text |
getFiltsValues :: forall val. PersistEntity val => Connection -> [Filter val] -> [PersistValue]Source
selectSourceConn :: (ResourceIO m, PersistEntity val, SqlPersist ~ PersistEntityBackend val) => Connection -> [Filter val] -> [SelectOpt val] -> Source m (Entity val)Source
Equivalent to selectSource
, but instead of getting the connection from
the environment inside a SqlPersist
monad, provide an explicit
Connection
. This can allow you to use the returned Source
in an
arbitrary monad.
dummyFromFilts :: [Filter v] -> vSource
:: PersistEntity val | |
=> Bool | include the table name |
-> Connection | |
-> SelectOpt val | |
-> Text |