persistent-mtl-0.5.2: 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 :: forall record. PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record (Maybe record)

Constructor corresponding to get

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

Constructor corresponding to getMany

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

Constructor corresponding to getJust

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

Constructor corresponding to getJustEntity

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

Constructor corresponding to getEntity

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

Constructor corresponding to belongsTo

BelongsToJust :: forall record1 a. (PersistEntity record1, PersistRecordBackend a SqlBackend) => (record1 -> Key a) -> record1 -> SqlQueryRep (record1, a) a

Constructor corresponding to belongsToJust

Insert :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Key record)

Constructor corresponding to insert

Insert_ :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record ()

Constructor corresponding to insert_

InsertMany :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> SqlQueryRep record [Key record]

Constructor corresponding to insertMany

InsertMany_ :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> SqlQueryRep record ()

Constructor corresponding to insertMany_

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

Constructor corresponding to insertEntityMany

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

Constructor corresponding to insertKey

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

Constructor corresponding to repsert

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

Constructor corresponding to repsertMany

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

Constructor corresponding to replace

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

Constructor corresponding to delete

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

Constructor corresponding to update

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

Constructor corresponding to updateGet

InsertEntity :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Entity record)

Constructor corresponding to insertEntity

InsertRecord :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record record

Constructor corresponding to insertRecord

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

Constructor corresponding to getBy

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

Constructor corresponding to getByValue

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

Constructor corresponding to checkUnique

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

Constructor corresponding to checkUniqueUpdateable

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

Constructor corresponding to deleteBy

InsertUnique :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Maybe (Key record))

Constructor corresponding to insertUnique

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

Constructor corresponding to upsert

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

Constructor corresponding to upsertBy

PutMany :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> SqlQueryRep record ()

Constructor corresponding to putMany

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

Constructor corresponding to insertBy

InsertUniqueEntity :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Maybe (Entity record))

Constructor corresponding to insertUniqueEntity

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

Constructor corresponding to replaceUnique

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

Constructor corresponding to onlyUnique

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

Constructor corresponding to selectSourceRes

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

Constructor corresponding to selectFirst

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

Constructor corresponding to selectKeysRes

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

Constructor corresponding to count

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

Constructor corresponding to exists

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

Constructor corresponding to selectList

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

Constructor corresponding to selectKeysList

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

Constructor corresponding to updateWhere

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

Constructor corresponding to deleteWhere

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

Constructor corresponding to deleteWhereCount

UpdateWhereCount :: forall record. 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 [(Bool, Sql)]

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 :: forall record typ. PersistRecordBackend record SqlBackend => EntityField record typ -> SqlQueryRep record Text

Constructor corresponding to getFieldName

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

Constructor corresponding to getTableName

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

Constructor corresponding to withRawQuery

RawQueryRes :: forall (m2 :: Type -> Type). 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 :: forall a1. RawSql a1 => Text -> [PersistValue] -> SqlQueryRep Void [a1]

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 :: forall a. Text -> (forall (m :: Type -> Type). 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 :: forall (m :: Type -> Type) record a. MonadUnliftIO m => SqlQueryRep record a -> SqlPersistT m a Source #

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