persistent-mtl-0.4.0.0: Monad transformer for the persistent API
Safe HaskellNone
LanguageHaskell2010

Database.Persist.Monad.SqlQueryRep

Description

Defines the SqlQueryRep data type that contains a constructor corresponding to a persistent function.

This file is autogenerated, to keep it in sync with Database.Persist.Monad.Shim.

Synopsis

Documentation

data SqlQueryRep record a where Source #

The data type containing a constructor for each persistent function we'd like to lift into MonadSqlQuery.

The record type parameter contains the PersistEntity types used in a given function.

We're using a free-monads-like technique here to allow us to introspect persistent functions in MonadSqlQuery, e.g. to mock out persistent calls in tests.

Constructors

Get :: PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record (Maybe record)

Constructor corresponding to get

GetMany :: PersistRecordBackend record SqlBackend => [Key record] -> SqlQueryRep record (Map (Key record) record)

Constructor corresponding to getMany

GetJust :: PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record record

Constructor corresponding to getJust

GetJustEntity :: PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record (Entity record)

Constructor corresponding to getJustEntity

GetEntity :: PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record (Maybe (Entity record))

Constructor corresponding to getEntity

BelongsTo :: (PersistEntity record1, PersistRecordBackend record2 SqlBackend) => (record1 -> Maybe (Key record2)) -> record1 -> SqlQueryRep (record1, record2) (Maybe record2)

Constructor corresponding to belongsTo

BelongsToJust :: (PersistEntity record1, PersistRecordBackend record2 SqlBackend) => (record1 -> Key record2) -> record1 -> SqlQueryRep (record1, record2) record2

Constructor corresponding to belongsToJust

Insert :: PersistRecordBackend record SqlBackend => record -> SqlQueryRep record (Key record)

Constructor corresponding to insert

Insert_ :: PersistRecordBackend record SqlBackend => record -> SqlQueryRep record ()

Constructor corresponding to insert_

InsertMany :: PersistRecordBackend record SqlBackend => [record] -> SqlQueryRep record [Key record]

Constructor corresponding to insertMany

InsertMany_ :: PersistRecordBackend record SqlBackend => [record] -> SqlQueryRep record ()

Constructor corresponding to insertMany_

InsertEntityMany :: PersistRecordBackend record SqlBackend => [Entity record] -> SqlQueryRep record ()

Constructor corresponding to insertEntityMany

InsertKey :: PersistRecordBackend record SqlBackend => Key record -> record -> SqlQueryRep record ()

Constructor corresponding to insertKey

Repsert :: PersistRecordBackend record SqlBackend => Key record -> record -> SqlQueryRep record ()

Constructor corresponding to repsert

RepsertMany :: PersistRecordBackend record SqlBackend => [(Key record, record)] -> SqlQueryRep record ()

Constructor corresponding to repsertMany

Replace :: PersistRecordBackend record SqlBackend => Key record -> record -> SqlQueryRep record ()

Constructor corresponding to replace

Delete :: PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record ()

Constructor corresponding to delete

Update :: PersistRecordBackend record SqlBackend => Key record -> [Update record] -> SqlQueryRep record ()

Constructor corresponding to update

UpdateGet :: PersistRecordBackend record SqlBackend => Key record -> [Update record] -> SqlQueryRep record record

Constructor corresponding to updateGet

InsertEntity :: PersistRecordBackend record SqlBackend => record -> SqlQueryRep record (Entity record)

Constructor corresponding to insertEntity

InsertRecord :: PersistRecordBackend record SqlBackend => record -> SqlQueryRep record record

Constructor corresponding to insertRecord

GetBy :: PersistRecordBackend record SqlBackend => Unique record -> SqlQueryRep record (Maybe (Entity record))

Constructor corresponding to getBy

GetByValue :: (PersistRecordBackend record SqlBackend, AtLeastOneUniqueKey record) => record -> SqlQueryRep record (Maybe (Entity record))

Constructor corresponding to getByValue

CheckUnique :: PersistRecordBackend record SqlBackend => record -> SqlQueryRep record (Maybe (Unique record))

Constructor corresponding to checkUnique

CheckUniqueUpdateable :: PersistRecordBackend record SqlBackend => Entity record -> SqlQueryRep record (Maybe (Unique record))

Constructor corresponding to checkUniqueUpdateable

DeleteBy :: PersistRecordBackend record SqlBackend => Unique record -> SqlQueryRep record ()

Constructor corresponding to deleteBy

InsertUnique :: PersistRecordBackend record SqlBackend => record -> SqlQueryRep record (Maybe (Key record))

Constructor corresponding to insertUnique

Upsert :: (PersistRecordBackend record SqlBackend, OnlyOneUniqueKey record) => record -> [Update record] -> SqlQueryRep record (Entity record)

Constructor corresponding to upsert

UpsertBy :: PersistRecordBackend record SqlBackend => Unique record -> record -> [Update record] -> SqlQueryRep record (Entity record)

Constructor corresponding to upsertBy

PutMany :: PersistRecordBackend record SqlBackend => [record] -> SqlQueryRep record ()

Constructor corresponding to putMany

InsertBy :: (PersistRecordBackend record SqlBackend, AtLeastOneUniqueKey record) => record -> SqlQueryRep record (Either (Entity record) (Key record))

Constructor corresponding to insertBy

InsertUniqueEntity :: PersistRecordBackend record SqlBackend => record -> SqlQueryRep record (Maybe (Entity record))

Constructor corresponding to insertUniqueEntity

ReplaceUnique :: (PersistRecordBackend record SqlBackend, Eq (Unique record), Eq record) => Key record -> record -> SqlQueryRep record (Maybe (Unique record))

Constructor corresponding to replaceUnique

OnlyUnique :: (PersistRecordBackend record SqlBackend, OnlyOneUniqueKey record) => record -> SqlQueryRep record (Unique record)

Constructor corresponding to onlyUnique

SelectSourceRes :: (MonadIO m2, PersistRecordBackend record SqlBackend) => [Filter record] -> [SelectOpt record] -> SqlQueryRep record (Acquire (ConduitM () (Entity record) m2 ()))

Constructor corresponding to selectSourceRes

SelectFirst :: PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record (Maybe (Entity record))

Constructor corresponding to selectFirst

SelectKeysRes :: (MonadIO m2, PersistRecordBackend record SqlBackend) => [Filter record] -> [SelectOpt record] -> SqlQueryRep record (Acquire (ConduitM () (Key record) m2 ()))

Constructor corresponding to selectKeysRes

Count :: PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record Int

Constructor corresponding to count

Exists :: PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record Bool

Constructor corresponding to exists

SelectList :: PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record [Entity record]

Constructor corresponding to selectList

SelectKeysList :: PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record [Key record]

Constructor corresponding to selectKeysList

UpdateWhere :: PersistRecordBackend record SqlBackend => [Filter record] -> [Update record] -> SqlQueryRep record ()

Constructor corresponding to updateWhere

DeleteWhere :: PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record ()

Constructor corresponding to deleteWhere

DeleteWhereCount :: PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record Int64

Constructor corresponding to deleteWhereCount

UpdateWhereCount :: PersistRecordBackend record SqlBackend => [Filter record] -> [Update record] -> SqlQueryRep record Int64

Constructor corresponding to updateWhereCount

ParseMigration :: HasCallStack => Migration -> SqlQueryRep Void (Either [Text] CautiousMigration)

Constructor corresponding to parseMigration

ParseMigration' :: HasCallStack => Migration -> SqlQueryRep Void CautiousMigration

Constructor corresponding to parseMigration'

PrintMigration :: HasCallStack => Migration -> SqlQueryRep Void ()

Constructor corresponding to printMigration

ShowMigration :: HasCallStack => Migration -> SqlQueryRep Void [Text]

Constructor corresponding to showMigration

GetMigration :: HasCallStack => Migration -> SqlQueryRep Void [Sql]

Constructor corresponding to getMigration

RunMigration :: Migration -> SqlQueryRep Void ()

Constructor corresponding to runMigration

RunMigrationQuiet :: Migration -> SqlQueryRep Void [Text]

Constructor corresponding to runMigrationQuiet

RunMigrationSilent :: Migration -> SqlQueryRep Void [Text]

Constructor corresponding to runMigrationSilent

RunMigrationUnsafe :: Migration -> SqlQueryRep Void ()

Constructor corresponding to runMigrationUnsafe

RunMigrationUnsafeQuiet :: HasCallStack => Migration -> SqlQueryRep Void [Text]

Constructor corresponding to runMigrationUnsafeQuiet

GetFieldName :: PersistRecordBackend record SqlBackend => EntityField record typ -> SqlQueryRep record Text

Constructor corresponding to getFieldName

GetTableName :: PersistRecordBackend record SqlBackend => record -> SqlQueryRep record Text

Constructor corresponding to getTableName

WithRawQuery :: Text -> [PersistValue] -> ConduitM [PersistValue] Void IO a -> SqlQueryRep Void a

Constructor corresponding to withRawQuery

RawQueryRes :: MonadIO m2 => Text -> [PersistValue] -> SqlQueryRep Void (Acquire (ConduitM () [PersistValue] m2 ()))

Constructor corresponding to rawQueryRes

RawExecute :: Text -> [PersistValue] -> SqlQueryRep Void ()

Constructor corresponding to rawExecute

RawExecuteCount :: Text -> [PersistValue] -> SqlQueryRep Void Int64

Constructor corresponding to rawExecuteCount

RawSql :: RawSql a => Text -> [PersistValue] -> SqlQueryRep Void [a]

Constructor corresponding to rawSql

TransactionSave :: SqlQueryRep Void ()

Constructor corresponding to transactionSave

TransactionSaveWithIsolation :: IsolationLevel -> SqlQueryRep Void ()

Constructor corresponding to transactionSaveWithIsolation

TransactionUndo :: SqlQueryRep Void ()

Constructor corresponding to transactionUndo

TransactionUndoWithIsolation :: IsolationLevel -> SqlQueryRep Void ()

Constructor corresponding to transactionUndoWithIsolation

UnsafeLiftSql :: Text -> (forall m. MonadIO m => SqlPersistT m a) -> SqlQueryRep Void a

Constructor for lifting an arbitrary SqlPersistT action into SqlQueryRep.

Instances

Instances details
Typeable record => Show (SqlQueryRep record a) Source # 
Instance details

Defined in Database.Persist.Monad.SqlQueryRep

Methods

showsPrec :: Int -> SqlQueryRep record a -> ShowS #

show :: SqlQueryRep record a -> String #

showList :: [SqlQueryRep record a] -> ShowS #

runSqlQueryRep :: MonadUnliftIO m => SqlQueryRep record a -> SqlPersistT m a Source #

A helper to execute the actual persistent function corresponding to each SqlQueryRep data constructor.