Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data SqlQueryRep record a where
- Get :: forall record. PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record (Maybe record)
- GetMany :: forall record. PersistRecordBackend record SqlBackend => [Key record] -> SqlQueryRep record (Map (Key record) record)
- GetJust :: forall record. PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record record
- GetJustEntity :: forall record. PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record (Entity record)
- GetEntity :: forall record. PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record (Maybe (Entity record))
- BelongsTo :: forall record1 record2. (PersistEntity record1, PersistRecordBackend record2 SqlBackend) => (record1 -> Maybe (Key record2)) -> record1 -> SqlQueryRep (record1, record2) (Maybe record2)
- BelongsToJust :: forall record1 a. (PersistEntity record1, PersistRecordBackend a SqlBackend) => (record1 -> Key a) -> record1 -> SqlQueryRep (record1, a) a
- Insert :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Key record)
- Insert_ :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record ()
- InsertMany :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> SqlQueryRep record [Key record]
- InsertMany_ :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> SqlQueryRep record ()
- InsertEntityMany :: forall record. PersistRecordBackend record SqlBackend => [Entity record] -> SqlQueryRep record ()
- InsertKey :: forall record. PersistRecordBackend record SqlBackend => Key record -> record -> SqlQueryRep record ()
- Repsert :: forall record. PersistRecordBackend record SqlBackend => Key record -> record -> SqlQueryRep record ()
- RepsertMany :: forall record. PersistRecordBackend record SqlBackend => [(Key record, record)] -> SqlQueryRep record ()
- Replace :: forall record. PersistRecordBackend record SqlBackend => Key record -> record -> SqlQueryRep record ()
- Delete :: forall record. PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record ()
- Update :: forall record. PersistRecordBackend record SqlBackend => Key record -> [Update record] -> SqlQueryRep record ()
- UpdateGet :: forall record. PersistRecordBackend record SqlBackend => Key record -> [Update record] -> SqlQueryRep record record
- InsertEntity :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Entity record)
- InsertRecord :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record record
- GetBy :: forall record. PersistRecordBackend record SqlBackend => Unique record -> SqlQueryRep record (Maybe (Entity record))
- GetByValue :: forall record. (PersistRecordBackend record SqlBackend, AtLeastOneUniqueKey record) => record -> SqlQueryRep record (Maybe (Entity record))
- CheckUnique :: forall record. PersistRecordBackend record SqlBackend => record -> SqlQueryRep record (Maybe (Unique record))
- CheckUniqueUpdateable :: forall record. PersistRecordBackend record SqlBackend => Entity record -> SqlQueryRep record (Maybe (Unique record))
- DeleteBy :: forall record. PersistRecordBackend record SqlBackend => Unique record -> SqlQueryRep record ()
- InsertUnique :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Maybe (Key record))
- Upsert :: forall record. (PersistRecordBackend record SqlBackend, OnlyOneUniqueKey record, SafeToInsert record) => record -> [Update record] -> SqlQueryRep record (Entity record)
- UpsertBy :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => Unique record -> record -> [Update record] -> SqlQueryRep record (Entity record)
- PutMany :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> SqlQueryRep record ()
- InsertBy :: forall record. (PersistRecordBackend record SqlBackend, AtLeastOneUniqueKey record, SafeToInsert record) => record -> SqlQueryRep record (Either (Entity record) (Key record))
- InsertUniqueEntity :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Maybe (Entity record))
- ReplaceUnique :: forall record. (PersistRecordBackend record SqlBackend, Eq (Unique record), Eq record) => Key record -> record -> SqlQueryRep record (Maybe (Unique record))
- OnlyUnique :: forall record. (PersistRecordBackend record SqlBackend, OnlyOneUniqueKey record) => record -> SqlQueryRep record (Unique record)
- SelectSourceRes :: forall (m2 :: Type -> Type) record. (MonadIO m2, PersistRecordBackend record SqlBackend) => [Filter record] -> [SelectOpt record] -> SqlQueryRep record (Acquire (ConduitM () (Entity record) m2 ()))
- SelectFirst :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record (Maybe (Entity record))
- SelectKeysRes :: forall (m2 :: Type -> Type) record. (MonadIO m2, PersistRecordBackend record SqlBackend) => [Filter record] -> [SelectOpt record] -> SqlQueryRep record (Acquire (ConduitM () (Key record) m2 ()))
- Count :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record Int
- Exists :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record Bool
- SelectList :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record [Entity record]
- SelectKeysList :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record [Key record]
- UpdateWhere :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> [Update record] -> SqlQueryRep record ()
- DeleteWhere :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record ()
- DeleteWhereCount :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record Int64
- UpdateWhereCount :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> [Update record] -> SqlQueryRep record Int64
- ParseMigration :: HasCallStack => Migration -> SqlQueryRep Void (Either [Text] CautiousMigration)
- ParseMigration' :: HasCallStack => Migration -> SqlQueryRep Void [(Bool, Sql)]
- PrintMigration :: HasCallStack => Migration -> SqlQueryRep Void ()
- ShowMigration :: HasCallStack => Migration -> SqlQueryRep Void [Text]
- GetMigration :: HasCallStack => Migration -> SqlQueryRep Void [Sql]
- RunMigration :: Migration -> SqlQueryRep Void ()
- RunMigrationQuiet :: Migration -> SqlQueryRep Void [Text]
- RunMigrationSilent :: Migration -> SqlQueryRep Void [Text]
- RunMigrationUnsafe :: Migration -> SqlQueryRep Void ()
- RunMigrationUnsafeQuiet :: HasCallStack => Migration -> SqlQueryRep Void [Text]
- GetFieldName :: forall record typ. PersistRecordBackend record SqlBackend => EntityField record typ -> SqlQueryRep record Text
- GetTableName :: forall record. PersistRecordBackend record SqlBackend => record -> SqlQueryRep record Text
- WithRawQuery :: forall a. Text -> [PersistValue] -> ConduitM [PersistValue] Void IO a -> SqlQueryRep Void a
- RawQueryRes :: forall (m2 :: Type -> Type). MonadIO m2 => Text -> [PersistValue] -> SqlQueryRep Void (Acquire (ConduitM () [PersistValue] m2 ()))
- RawExecute :: Text -> [PersistValue] -> SqlQueryRep Void ()
- RawExecuteCount :: Text -> [PersistValue] -> SqlQueryRep Void Int64
- RawSql :: forall a1. RawSql a1 => Text -> [PersistValue] -> SqlQueryRep Void [a1]
- TransactionSave :: SqlQueryRep Void ()
- TransactionSaveWithIsolation :: IsolationLevel -> SqlQueryRep Void ()
- TransactionUndo :: SqlQueryRep Void ()
- TransactionUndoWithIsolation :: IsolationLevel -> SqlQueryRep Void ()
- UnsafeLiftSql :: forall a. Text -> (forall (m :: Type -> Type). MonadIO m => SqlPersistT m a) -> SqlQueryRep Void a
- runSqlQueryRep :: forall (m :: Type -> Type) record a. MonadUnliftIO m => SqlQueryRep record a -> SqlPersistT m a
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 |
GetMany :: forall record. PersistRecordBackend record SqlBackend => [Key record] -> SqlQueryRep record (Map (Key record) record) | Constructor corresponding to |
GetJust :: forall record. PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record record | Constructor corresponding to |
GetJustEntity :: forall record. PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record (Entity record) | Constructor corresponding to |
GetEntity :: forall record. PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record (Maybe (Entity record)) | Constructor corresponding to |
BelongsTo :: forall record1 record2. (PersistEntity record1, PersistRecordBackend record2 SqlBackend) => (record1 -> Maybe (Key record2)) -> record1 -> SqlQueryRep (record1, record2) (Maybe record2) | Constructor corresponding to |
BelongsToJust :: forall record1 a. (PersistEntity record1, PersistRecordBackend a SqlBackend) => (record1 -> Key a) -> record1 -> SqlQueryRep (record1, a) a | Constructor corresponding to |
Insert :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Key record) | Constructor corresponding to |
Insert_ :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record () | Constructor corresponding to |
InsertMany :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> SqlQueryRep record [Key record] | Constructor corresponding to |
InsertMany_ :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> SqlQueryRep record () | Constructor corresponding to |
InsertEntityMany :: forall record. PersistRecordBackend record SqlBackend => [Entity record] -> SqlQueryRep record () | Constructor corresponding to |
InsertKey :: forall record. PersistRecordBackend record SqlBackend => Key record -> record -> SqlQueryRep record () | Constructor corresponding to |
Repsert :: forall record. PersistRecordBackend record SqlBackend => Key record -> record -> SqlQueryRep record () | Constructor corresponding to |
RepsertMany :: forall record. PersistRecordBackend record SqlBackend => [(Key record, record)] -> SqlQueryRep record () | Constructor corresponding to |
Replace :: forall record. PersistRecordBackend record SqlBackend => Key record -> record -> SqlQueryRep record () | Constructor corresponding to |
Delete :: forall record. PersistRecordBackend record SqlBackend => Key record -> SqlQueryRep record () | Constructor corresponding to |
Update :: forall record. PersistRecordBackend record SqlBackend => Key record -> [Update record] -> SqlQueryRep record () | Constructor corresponding to |
UpdateGet :: forall record. PersistRecordBackend record SqlBackend => Key record -> [Update record] -> SqlQueryRep record record | Constructor corresponding to |
InsertEntity :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Entity record) | Constructor corresponding to |
InsertRecord :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record record | Constructor corresponding to |
GetBy :: forall record. PersistRecordBackend record SqlBackend => Unique record -> SqlQueryRep record (Maybe (Entity record)) | Constructor corresponding to |
GetByValue :: forall record. (PersistRecordBackend record SqlBackend, AtLeastOneUniqueKey record) => record -> SqlQueryRep record (Maybe (Entity record)) | Constructor corresponding to |
CheckUnique :: forall record. PersistRecordBackend record SqlBackend => record -> SqlQueryRep record (Maybe (Unique record)) | Constructor corresponding to |
CheckUniqueUpdateable :: forall record. PersistRecordBackend record SqlBackend => Entity record -> SqlQueryRep record (Maybe (Unique record)) | Constructor corresponding to |
DeleteBy :: forall record. PersistRecordBackend record SqlBackend => Unique record -> SqlQueryRep record () | Constructor corresponding to |
InsertUnique :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Maybe (Key record)) | Constructor corresponding to |
Upsert :: forall record. (PersistRecordBackend record SqlBackend, OnlyOneUniqueKey record, SafeToInsert record) => record -> [Update record] -> SqlQueryRep record (Entity record) | Constructor corresponding to |
UpsertBy :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => Unique record -> record -> [Update record] -> SqlQueryRep record (Entity record) | Constructor corresponding to |
PutMany :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> SqlQueryRep record () | Constructor corresponding to |
InsertBy :: forall record. (PersistRecordBackend record SqlBackend, AtLeastOneUniqueKey record, SafeToInsert record) => record -> SqlQueryRep record (Either (Entity record) (Key record)) | Constructor corresponding to |
InsertUniqueEntity :: forall record. (PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> SqlQueryRep record (Maybe (Entity record)) | Constructor corresponding to |
ReplaceUnique :: forall record. (PersistRecordBackend record SqlBackend, Eq (Unique record), Eq record) => Key record -> record -> SqlQueryRep record (Maybe (Unique record)) | Constructor corresponding to |
OnlyUnique :: forall record. (PersistRecordBackend record SqlBackend, OnlyOneUniqueKey record) => record -> SqlQueryRep record (Unique record) | Constructor corresponding to |
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 |
SelectFirst :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record (Maybe (Entity record)) | Constructor corresponding to |
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 |
Count :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record Int | Constructor corresponding to |
Exists :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record Bool | Constructor corresponding to |
SelectList :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record [Entity record] | Constructor corresponding to |
SelectKeysList :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record [Key record] | Constructor corresponding to |
UpdateWhere :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> [Update record] -> SqlQueryRep record () | Constructor corresponding to |
DeleteWhere :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record () | Constructor corresponding to |
DeleteWhereCount :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> SqlQueryRep record Int64 | Constructor corresponding to |
UpdateWhereCount :: forall record. PersistRecordBackend record SqlBackend => [Filter record] -> [Update record] -> SqlQueryRep record Int64 | Constructor corresponding to |
ParseMigration :: HasCallStack => Migration -> SqlQueryRep Void (Either [Text] CautiousMigration) | Constructor corresponding to |
ParseMigration' :: HasCallStack => Migration -> SqlQueryRep Void [(Bool, Sql)] | Constructor corresponding to |
PrintMigration :: HasCallStack => Migration -> SqlQueryRep Void () | Constructor corresponding to |
ShowMigration :: HasCallStack => Migration -> SqlQueryRep Void [Text] | Constructor corresponding to |
GetMigration :: HasCallStack => Migration -> SqlQueryRep Void [Sql] | Constructor corresponding to |
RunMigration :: Migration -> SqlQueryRep Void () | Constructor corresponding to |
RunMigrationQuiet :: Migration -> SqlQueryRep Void [Text] | Constructor corresponding to |
RunMigrationSilent :: Migration -> SqlQueryRep Void [Text] | Constructor corresponding to |
RunMigrationUnsafe :: Migration -> SqlQueryRep Void () | Constructor corresponding to |
RunMigrationUnsafeQuiet :: HasCallStack => Migration -> SqlQueryRep Void [Text] | Constructor corresponding to |
GetFieldName :: forall record typ. PersistRecordBackend record SqlBackend => EntityField record typ -> SqlQueryRep record Text | Constructor corresponding to |
GetTableName :: forall record. PersistRecordBackend record SqlBackend => record -> SqlQueryRep record Text | Constructor corresponding to |
WithRawQuery :: forall a. Text -> [PersistValue] -> ConduitM [PersistValue] Void IO a -> SqlQueryRep Void a | Constructor corresponding to |
RawQueryRes :: forall (m2 :: Type -> Type). MonadIO m2 => Text -> [PersistValue] -> SqlQueryRep Void (Acquire (ConduitM () [PersistValue] m2 ())) | Constructor corresponding to |
RawExecute :: Text -> [PersistValue] -> SqlQueryRep Void () | Constructor corresponding to |
RawExecuteCount :: Text -> [PersistValue] -> SqlQueryRep Void Int64 | Constructor corresponding to |
RawSql :: forall a1. RawSql a1 => Text -> [PersistValue] -> SqlQueryRep Void [a1] | Constructor corresponding to |
TransactionSave :: SqlQueryRep Void () | Constructor corresponding to |
TransactionSaveWithIsolation :: IsolationLevel -> SqlQueryRep Void () | Constructor corresponding to |
TransactionUndo :: SqlQueryRep Void () | Constructor corresponding to |
TransactionUndoWithIsolation :: IsolationLevel -> SqlQueryRep Void () | Constructor corresponding to |
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
Typeable record => Show (SqlQueryRep record a) Source # | |
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.