| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.Esqueleto.Legacy
Description
WARNING
This module is introduced in version 3.5.0.0 to provide a smooth migration
experience from this legacy syntax to the new and improved syntax. If you've
imported this module, it means you've decided to use the old syntax for
a little bit longer, rather than migrate to the new stuff. That's fine!
But you should know that this module, and all of the legacy syntax, will be
completely removed from the library in version 4.0.0.0.
The esqueleto EDSL (embedded domain specific language).
This module replaces Database.Persist, so instead of
importing that module you should just import this one:
-- For a module using just esqueleto. import Database.Esqueleto
If you need to use persistent's default support for queries
as well, either import it qualified:
-- For a module that mostly uses esqueleto. import Database.Esqueleto import qualified Database.Persist as P
or import esqueleto itself qualified:
-- For a module that uses esqueleto just on some queries. import Database.Persist import qualified Database.Esqueleto as E
Other than identifier name clashes, esqueleto does not
conflict with persistent in any way.
Synopsis
- where_ :: SqlExpr (Value Bool) -> SqlQuery ()
- on :: SqlExpr (Value Bool) -> SqlQuery ()
- groupBy :: ToSomeValues a => a -> SqlQuery ()
- orderBy :: [SqlExpr OrderBy] -> SqlQuery ()
- asc :: PersistField a => SqlExpr (Value a) -> SqlExpr OrderBy
- desc :: PersistField a => SqlExpr (Value a) -> SqlExpr OrderBy
- limit :: Int64 -> SqlQuery ()
- offset :: Int64 -> SqlQuery ()
- distinct :: SqlQuery a -> SqlQuery a
- distinctOn :: [SqlExpr DistinctOn] -> SqlQuery a -> SqlQuery a
- don :: SqlExpr (Value a) -> SqlExpr DistinctOn
- distinctOnOrderBy :: [SqlExpr OrderBy] -> SqlQuery a -> SqlQuery a
- having :: SqlExpr (Value Bool) -> SqlQuery ()
- locking :: LockingKind -> SqlQuery ()
- (^.) :: forall typ val. (PersistEntity val, PersistField typ) => SqlExpr (Entity val) -> EntityField val typ -> SqlExpr (Value typ)
- (?.) :: (PersistEntity val, PersistField typ) => SqlExpr (Maybe (Entity val)) -> EntityField val typ -> SqlExpr (Value (Maybe (Nullable typ)))
- val :: PersistField typ => typ -> SqlExpr (Value typ)
- isNothing :: PersistField typ => SqlExpr (Value (Maybe typ)) -> SqlExpr (Value Bool)
- just :: NullableFieldProjection typ typ' => SqlExpr (Value typ) -> SqlExpr (Value (Maybe typ'))
- just' :: SqlExpr (Value typ) -> SqlExpr (Value (Maybe typ))
- nothing :: SqlExpr (Value (Maybe typ))
- joinV :: NullableFieldProjection typ typ' => SqlExpr (Value (Maybe typ)) -> SqlExpr (Value (Maybe typ'))
- joinV' :: SqlExpr (Value (Maybe (Maybe typ))) -> SqlExpr (Value (Maybe typ))
- withNonNull :: PersistField typ => SqlExpr (Value (Maybe typ)) -> (SqlExpr (Value typ) -> SqlQuery a) -> SqlQuery a
- countRows :: Num a => SqlExpr (Value a)
- count :: Num a => SqlExpr (Value typ) -> SqlExpr (Value a)
- countDistinct :: Num a => SqlExpr (Value typ) -> SqlExpr (Value a)
- not_ :: SqlExpr (Value Bool) -> SqlExpr (Value Bool)
- (==.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
- (>=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
- (>.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
- (<=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
- (<.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
- (!=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
- (&&.) :: SqlExpr (Value Bool) -> SqlExpr (Value Bool) -> SqlExpr (Value Bool)
- (||.) :: SqlExpr (Value Bool) -> SqlExpr (Value Bool) -> SqlExpr (Value Bool)
- between :: PersistField a => SqlExpr (Value a) -> (SqlExpr (Value a), SqlExpr (Value a)) -> SqlExpr (Value Bool)
- (+.) :: PersistField a => SqlExpr (Value a) -> SqlExpr (Value a) -> SqlExpr (Value a)
- (-.) :: PersistField a => SqlExpr (Value a) -> SqlExpr (Value a) -> SqlExpr (Value a)
- (/.) :: PersistField a => SqlExpr (Value a) -> SqlExpr (Value a) -> SqlExpr (Value a)
- (*.) :: PersistField a => SqlExpr (Value a) -> SqlExpr (Value a) -> SqlExpr (Value a)
- round_ :: (PersistField a, Num a, PersistField b, Num b) => SqlExpr (Value a) -> SqlExpr (Value b)
- ceiling_ :: (PersistField a, Num a, PersistField b, Num b) => SqlExpr (Value a) -> SqlExpr (Value b)
- floor_ :: (PersistField a, Num a, PersistField b, Num b) => SqlExpr (Value a) -> SqlExpr (Value b)
- min_ :: PersistField a => SqlExpr (Value a) -> SqlExpr (Value (Maybe (Nullable a)))
- max_ :: PersistField a => SqlExpr (Value a) -> SqlExpr (Value (Maybe (Nullable a)))
- sum_ :: (PersistField a, PersistField b) => SqlExpr (Value a) -> SqlExpr (Value (Maybe b))
- avg_ :: (PersistField a, PersistField b) => SqlExpr (Value a) -> SqlExpr (Value (Maybe b))
- castNum :: (Num a, Num b) => SqlExpr (Value a) -> SqlExpr (Value b)
- castNumM :: (Num a, Num b) => SqlExpr (Value (Maybe a)) -> SqlExpr (Value (Maybe b))
- coalesce :: (PersistField a, NullableFieldProjection a a') => [SqlExpr (Value (Maybe a))] -> SqlExpr (Value (Maybe a'))
- coalesceDefault :: PersistField a => [SqlExpr (Value (Maybe a))] -> SqlExpr (Value a) -> SqlExpr (Value a)
- lower_ :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s)
- upper_ :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s)
- trim_ :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s)
- ltrim_ :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s)
- rtrim_ :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s)
- length_ :: (SqlString s, Num a) => SqlExpr (Value s) -> SqlExpr (Value a)
- left_ :: (SqlString s, Num a) => (SqlExpr (Value s), SqlExpr (Value a)) -> SqlExpr (Value s)
- right_ :: (SqlString s, Num a) => (SqlExpr (Value s), SqlExpr (Value a)) -> SqlExpr (Value s)
- like :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s) -> SqlExpr (Value Bool)
- ilike :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s) -> SqlExpr (Value Bool)
- (%) :: SqlString s => SqlExpr (Value s)
- concat_ :: SqlString s => [SqlExpr (Value s)] -> SqlExpr (Value s)
- (++.) :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s) -> SqlExpr (Value s)
- castString :: (SqlString s, SqlString r) => SqlExpr (Value s) -> SqlExpr (Value r)
- subList_select :: PersistField a => SqlQuery (SqlExpr (Value a)) -> SqlExpr (ValueList a)
- valList :: PersistField typ => [typ] -> SqlExpr (ValueList typ)
- justList :: SqlExpr (ValueList typ) -> SqlExpr (ValueList (Maybe typ))
- in_ :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (ValueList typ) -> SqlExpr (Value Bool)
- notIn :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (ValueList typ) -> SqlExpr (Value Bool)
- exists :: SqlQuery () -> SqlExpr (Value Bool)
- notExists :: SqlQuery () -> SqlExpr (Value Bool)
- set :: PersistEntity val => SqlExpr (Entity val) -> [SqlExpr (Entity val) -> SqlExpr Update] -> SqlQuery ()
- (=.) :: (PersistEntity val, PersistField typ) => EntityField val typ -> SqlExpr (Value typ) -> SqlExpr (Entity val) -> SqlExpr Update
- (+=.) :: (PersistEntity val, PersistField a) => EntityField val a -> SqlExpr (Value a) -> SqlExpr (Entity val) -> SqlExpr Update
- (-=.) :: (PersistEntity val, PersistField a) => EntityField val a -> SqlExpr (Value a) -> SqlExpr (Entity val) -> SqlExpr Update
- (*=.) :: (PersistEntity val, PersistField a) => EntityField val a -> SqlExpr (Value a) -> SqlExpr (Entity val) -> SqlExpr Update
- (/=.) :: (PersistEntity val, PersistField a) => EntityField val a -> SqlExpr (Value a) -> SqlExpr (Entity val) -> SqlExpr Update
- case_ :: PersistField a => [(SqlExpr (Value Bool), SqlExpr (Value a))] -> SqlExpr (Value a) -> SqlExpr (Value a)
- toBaseId :: ToBaseId ent => SqlExpr (Value (Key ent)) -> SqlExpr (Value (Key (BaseEnt ent)))
- fromBaseId :: ToBaseId ent => SqlExpr (Value (Key (BaseEnt ent))) -> SqlExpr (Value (Key ent))
- fromBaseIdMaybe :: ToBaseId ent => SqlExpr (Value (Maybe (Key (BaseEnt ent)))) -> SqlExpr (Value (Maybe (Key ent)))
- toBaseIdMaybe :: ToBaseId ent => SqlExpr (Value (Maybe (Key ent))) -> SqlExpr (Value (Maybe (Key (BaseEnt ent))))
- subSelect :: (PersistField a, NullableFieldProjection a a') => SqlQuery (SqlExpr (Value a)) -> SqlExpr (Value (Maybe a'))
- subSelectMaybe :: PersistField a => SqlQuery (SqlExpr (Value (Maybe a))) -> SqlExpr (Value (Maybe a))
- subSelectCount :: (Num a, PersistField a) => SqlQuery ignored -> SqlExpr (Value a)
- subSelectForeign :: (BackendCompatible SqlBackend (PersistEntityBackend val1), PersistEntity val1, PersistEntity val2, PersistField a) => SqlExpr (Entity val2) -> EntityField val2 (Key val1) -> (SqlExpr (Entity val1) -> SqlExpr (Value a)) -> SqlExpr (Value a)
- subSelectList :: PersistField a => SqlQuery (SqlExpr (Value a)) -> SqlExpr (ValueList a)
- subSelectUnsafe :: PersistField a => SqlQuery (SqlExpr (Value a)) -> SqlExpr (Value a)
- class ToBaseId ent where
- type BaseEnt ent
- toBaseIdWitness :: Key (BaseEnt ent) -> Key ent
- when_ :: expr (Value Bool) -> () -> expr a -> (expr (Value Bool), expr a)
- then_ :: ()
- else_ :: expr a -> expr a
- from :: From a => (a -> SqlQuery b) -> SqlQuery b
- newtype Value a = Value {
- unValue :: a
- newtype ValueList a = ValueList a
- data OrderBy
- data DistinctOn
- data LockingKind
- forUpdate :: LockingKind
- forUpdateSkipLocked :: LockingKind
- class LockableEntity a where
- flattenLockableEntity :: a -> NonEmpty LockableSqlExpr
- class PersistField a => SqlString a
- data InnerJoin a b = a `InnerJoin` b
- data CrossJoin a b = a `CrossJoin` b
- data LeftOuterJoin a b = a `LeftOuterJoin` b
- data RightOuterJoin a b = a `RightOuterJoin` b
- data FullOuterJoin a b = a `FullOuterJoin` b
- data JoinKind
- data OnClauseWithoutMatchingJoinException = OnClauseWithoutMatchingJoinException String
- data SqlQuery a
- data SqlExpr a
- type SqlEntity ent = (PersistEntity ent, PersistEntityBackend ent ~ SqlBackend)
- select :: forall a r (m :: Type -> Type) backend. (SqlSelect a r, MonadIO m, SqlBackendCanRead backend) => SqlQuery a -> ReaderT backend m [r]
- selectOne :: forall a r (m :: Type -> Type) backend. (SqlSelect a r, MonadIO m, SqlBackendCanRead backend) => SqlQuery a -> ReaderT backend m (Maybe r)
- selectSource :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, IsPersistBackend backend, PersistQueryRead backend, PersistStoreRead backend, PersistUniqueRead backend, MonadResource m) => SqlQuery a -> ConduitT () r (ReaderT backend m) ()
- delete :: forall (m :: Type -> Type) backend. (MonadIO m, SqlBackendCanWrite backend) => SqlQuery () -> ReaderT backend m ()
- deleteCount :: forall (m :: Type -> Type) backend. (MonadIO m, SqlBackendCanWrite backend) => SqlQuery () -> ReaderT backend m Int64
- update :: forall (m :: Type -> Type) val backend. (MonadIO m, PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val), SqlBackendCanWrite backend) => (SqlExpr (Entity val) -> SqlQuery ()) -> ReaderT backend m ()
- updateCount :: forall (m :: Type -> Type) val backend. (MonadIO m, PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val), SqlBackendCanWrite backend) => (SqlExpr (Entity val) -> SqlQuery ()) -> ReaderT backend m Int64
- insertSelect :: forall (m :: Type -> Type) a backend. (MonadIO m, PersistEntity a, SqlBackendCanWrite backend) => SqlQuery (SqlExpr (Insertion a)) -> ReaderT backend m ()
- insertSelectCount :: forall (m :: Type -> Type) a backend. (MonadIO m, PersistEntity a, SqlBackendCanWrite backend) => SqlQuery (SqlExpr (Insertion a)) -> ReaderT backend m Int64
- (<#) :: (a -> b) -> SqlExpr (Value a) -> SqlExpr (Insertion b)
- (<&>) :: SqlExpr (Insertion (a -> b)) -> SqlExpr (Value a) -> SqlExpr (Insertion b)
- renderQueryToText :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) => Mode -> SqlQuery a -> ReaderT backend m (Text, [PersistValue])
- renderQuerySelect :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) => SqlQuery a -> ReaderT backend m (Text, [PersistValue])
- renderQueryUpdate :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) => SqlQuery a -> ReaderT backend m (Text, [PersistValue])
- renderQueryDelete :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) => SqlQuery a -> ReaderT backend m (Text, [PersistValue])
- renderQueryInsertInto :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) => SqlQuery a -> ReaderT backend m (Text, [PersistValue])
- class From a
- valkey :: (ToBackendKey SqlBackend entity, PersistField (Key entity)) => Int64 -> SqlExpr (Value (Key entity))
- valJ :: PersistField (Key entity) => Value (Key entity) -> SqlExpr (Value (Key entity))
- associateJoin :: forall e1 e0. Ord (Key e0) => [(Entity e0, e1)] -> Map (Key e0) (e0, [e1])
- deleteKey :: forall backend val (m :: Type -> Type). (PersistStore backend, BaseBackend backend ~ PersistEntityBackend val, MonadIO m, PersistEntity val) => Key val -> ReaderT backend m ()
- data SqlType
- data IsNullable
- newtype EntityNameDB = EntityNameDB {
- unEntityNameDB :: Text
- newtype FieldNameDB = FieldNameDB {
- unFieldNameDB :: Text
- class SymbolToField (sym :: Symbol) rec typ | sym rec -> typ where
- symbolToField :: EntityField rec typ
- data SqlBackend
- type Sql = Text
- class (PersistUniqueRead backend, PersistStoreWrite backend) => PersistUniqueWrite backend where
- deleteBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Unique record -> ReaderT backend m ()
- insertUnique :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => record -> ReaderT backend m (Maybe (Key record))
- insertUnique_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => record -> ReaderT backend m (Maybe ())
- upsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, OnlyOneUniqueKey record, SafeToInsert record) => record -> [Update record] -> ReaderT backend m (Entity record)
- upsertBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => Unique record -> record -> [Update record] -> ReaderT backend m (Entity record)
- putMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m ()
- data UniqueDef = UniqueDef {
- uniqueHaskell :: !ConstraintNameHS
- uniqueDBName :: !ConstraintNameDB
- uniqueFields :: !(NonEmpty (FieldNameHS, FieldNameDB))
- uniqueAttrs :: ![Attr]
- newtype ConstraintNameDB = ConstraintNameDB {
- unConstraintNameDB :: Text
- class PersistEntity record => OnlyOneUniqueKey record where
- onlyUniqueP :: record -> Unique record
- data Entity record = Entity {}
- data PersistValue where
- PersistText Text
- PersistByteString ByteString
- PersistInt64 Int64
- PersistDouble Double
- PersistRational Rational
- PersistBool Bool
- PersistDay Day
- PersistTimeOfDay TimeOfDay
- PersistUTCTime UTCTime
- PersistNull
- PersistList [PersistValue]
- PersistMap [(Text, PersistValue)]
- PersistObjectId ByteString
- PersistArray [PersistValue]
- PersistLiteral_ LiteralType ByteString
- pattern PersistDbSpecific :: ByteString -> PersistValue
- pattern PersistLiteral :: ByteString -> PersistValue
- pattern PersistLiteralEscaped :: ByteString -> PersistValue
- data PersistFilter
- class (Show (BackendKey backend), Read (BackendKey backend), Eq (BackendKey backend), Ord (BackendKey backend), PersistStoreRead backend, PersistField (BackendKey backend), ToJSON (BackendKey backend), FromJSON (BackendKey backend)) => PersistStoreWrite backend where
- insert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => record -> ReaderT backend m (Key record)
- insert_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => record -> ReaderT backend m ()
- insertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m [Key record]
- insertMany_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m ()
- insertEntityMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => [Entity record] -> ReaderT backend m ()
- insertKey :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Key record -> record -> ReaderT backend m ()
- repsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Key record -> record -> ReaderT backend m ()
- repsertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => [(Key record, record)] -> ReaderT backend m ()
- replace :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Key record -> record -> ReaderT backend m ()
- updateGet :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Key record -> [Update record] -> ReaderT backend m record
- toJsonText :: ToJSON j => j -> Text
- type PersistStore a = PersistStoreWrite a
- type PersistUnique a = PersistUniqueWrite a
- class PersistConfig c where
- type PersistConfigBackend c :: (Type -> Type) -> Type -> Type
- type PersistConfigPool c
- loadConfig :: Value -> Parser c
- applyEnv :: c -> IO c
- createPoolConfig :: c -> IO (PersistConfigPool c)
- runPool :: MonadUnliftIO m => c -> PersistConfigBackend c m a -> PersistConfigPool c -> m a
- type family PersistConfigBackend c :: (Type -> Type) -> Type -> Type
- type family PersistConfigPool c
- type family BackendSpecificUpdate backend record
- data PersistUpdate
- class (PersistField (Key record), ToJSON (Key record), FromJSON (Key record), Show (Key record), Read (Key record), Eq (Key record), Ord (Key record)) => PersistEntity record where
- type PersistEntityBackend record
- data Key record
- data EntityField record :: Type -> Type
- data Unique record
- keyToValues :: Key record -> [PersistValue]
- keyFromValues :: [PersistValue] -> Either Text (Key record)
- persistIdField :: EntityField record (Key record)
- entityDef :: proxy record -> EntityDef
- persistFieldDef :: EntityField record typ -> FieldDef
- toPersistFields :: record -> [PersistValue]
- fromPersistValues :: [PersistValue] -> Either Text record
- tabulateEntityA :: Applicative f => (forall a. EntityField record a -> f a) -> f (Entity record)
- tabulateEntityApply :: Apply f => (forall a. EntityField record a -> f a) -> f (Entity record)
- persistUniqueKeys :: record -> [Unique record]
- persistUniqueToFieldNames :: Unique record -> NonEmpty (FieldNameHS, FieldNameDB)
- persistUniqueToValues :: Unique record -> [PersistValue]
- fieldLens :: EntityField record field -> forall (f :: Type -> Type). Functor f => (field -> f field) -> Entity record -> f (Entity record)
- keyFromRecordM :: Maybe (record -> Key record)
- data family EntityField record :: Type -> Type
- data FilterValue typ where
- FilterValue :: forall typ. typ -> FilterValue typ
- FilterValues :: forall typ. [typ] -> FilterValue typ
- UnsafeValue :: forall a typ. PersistField a => a -> FilterValue typ
- data family Key record
- type family PersistEntityBackend record
- class SafeToInsert a
- data family Unique record
- entityIdFromJSON :: (PersistEntity record, FromJSON record) => Value -> Parser (Entity record)
- entityIdToJSON :: (PersistEntity record, ToJSON record) => Entity record -> Value
- entityValues :: PersistEntity record => Entity record -> [PersistValue]
- fromPersistValueJSON :: FromJSON a => PersistValue -> Either Text a
- keyValueEntityFromJSON :: (PersistEntity record, FromJSON record) => Value -> Parser (Entity record)
- keyValueEntityToJSON :: (PersistEntity record, ToJSON record) => Entity record -> Value
- tabulateEntity :: PersistEntity record => (forall a. EntityField record a -> a) -> Entity record
- toPersistValueJSON :: ToJSON a => a -> PersistValue
- newtype OverflowNatural = OverflowNatural {
- unOverflowNatural :: Natural
- class PersistField a where
- toPersistValue :: a -> PersistValue
- fromPersistValue :: PersistValue -> Either Text a
- class (PersistCore backend, PersistStoreRead backend) => PersistQueryRead backend where
- selectSourceRes :: forall record (m1 :: Type -> Type) (m2 :: Type -> Type). (PersistRecordBackend record backend, MonadIO m1, MonadIO m2) => [Filter record] -> [SelectOpt record] -> ReaderT backend m1 (Acquire (ConduitM () (Entity record) m2 ()))
- selectFirst :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m (Maybe (Entity record))
- selectKeysRes :: forall (m1 :: Type -> Type) (m2 :: Type -> Type) record. (MonadIO m1, MonadIO m2, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m1 (Acquire (ConduitM () (Key record) m2 ()))
- class (PersistQueryRead backend, PersistStoreWrite backend) => PersistQueryWrite backend where
- updateWhere :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record backend) => [Filter record] -> [Update record] -> ReaderT backend m ()
- deleteWhere :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record backend) => [Filter record] -> ReaderT backend m ()
- selectKeys :: forall record backend (m :: Type -> Type). (PersistQueryRead backend, MonadResource m, PersistRecordBackend record backend, MonadReader backend m) => [Filter record] -> [SelectOpt record] -> ConduitM () (Key record) m ()
- class BackendCompatible sup sub where
- projectBackend :: sub -> sup
- class PersistCore backend where
- data BackendKey backend
- data family BackendKey backend
- class HasPersistBackend backend where
- type BaseBackend backend
- persistBackend :: backend -> BaseBackend backend
- type family BaseBackend backend
- class HasPersistBackend backend => IsPersistBackend backend
- type PersistRecordBackend record backend = (PersistEntity record, PersistEntityBackend record ~ BaseBackend backend)
- class (Show (BackendKey backend), Read (BackendKey backend), Eq (BackendKey backend), Ord (BackendKey backend), PersistCore backend, PersistField (BackendKey backend), ToJSON (BackendKey backend), FromJSON (BackendKey backend)) => PersistStoreRead backend where
- get :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Key record -> ReaderT backend m (Maybe record)
- getMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => [Key record] -> ReaderT backend m (Map (Key record) record)
- class (PersistEntity record, PersistEntityBackend record ~ backend, PersistCore backend) => ToBackendKey backend record where
- toBackendKey :: Key record -> BackendKey backend
- fromBackendKey :: BackendKey backend -> Key record
- belongsTo :: forall ent1 ent2 backend (m :: Type -> Type). (PersistStoreRead backend, PersistEntity ent1, PersistRecordBackend ent2 backend, MonadIO m) => (ent1 -> Maybe (Key ent2)) -> ent1 -> ReaderT backend m (Maybe ent2)
- belongsToJust :: forall ent1 ent2 backend (m :: Type -> Type). (PersistStoreRead backend, PersistEntity ent1, PersistRecordBackend ent2 backend, MonadIO m) => (ent1 -> Key ent2) -> ent1 -> ReaderT backend m ent2
- getEntity :: forall e backend (m :: Type -> Type). (PersistStoreRead backend, PersistRecordBackend e backend, MonadIO m) => Key e -> ReaderT backend m (Maybe (Entity e))
- getJust :: forall record backend (m :: Type -> Type). (PersistStoreRead backend, PersistRecordBackend record backend, MonadIO m) => Key record -> ReaderT backend m record
- getJustEntity :: forall record backend (m :: Type -> Type). (PersistEntityBackend record ~ BaseBackend backend, MonadIO m, PersistEntity record, PersistStoreRead backend) => Key record -> ReaderT backend m (Entity record)
- insertEntity :: forall e backend (m :: Type -> Type). (PersistStoreWrite backend, PersistRecordBackend e backend, SafeToInsert e, MonadIO m, HasCallStack) => e -> ReaderT backend m (Entity e)
- insertRecord :: forall record backend (m :: Type -> Type). (PersistEntityBackend record ~ BaseBackend backend, PersistEntity record, MonadIO m, PersistStoreWrite backend, SafeToInsert record, HasCallStack) => record -> ReaderT backend m record
- liftPersist :: (MonadIO m, MonadReader backend m) => ReaderT backend IO b -> m b
- withBaseBackend :: forall backend (m :: Type -> Type) a. HasPersistBackend backend => ReaderT (BaseBackend backend) m a -> ReaderT backend m a
- withCompatibleBackend :: forall sup sub (m :: Type -> Type) a. BackendCompatible sup sub => ReaderT sup m a -> ReaderT sub m a
- class PersistEntity record => AtLeastOneUniqueKey record where
- requireUniquesP :: record -> NonEmpty (Unique record)
- type MultipleUniqueKeysError ty = ((('Text "The entity " ':<>: 'ShowType ty) ':<>: 'Text " has multiple unique keys.") ':$$: ('Text "The function you are trying to call requires only a single " ':<>: 'Text "unique key.")) ':$$: (('Text "There is probably a variant of the function with 'By' " ':<>: 'Text "appended that will allow you to select a unique key ") ':<>: 'Text "for the operation.")
- type NoUniqueKeysError ty = (('Text "The entity " ':<>: 'ShowType ty) ':<>: 'Text " does not have any unique keys.") ':$$: ('Text "The function you are trying to call requires a unique key " ':<>: 'Text "to be defined on the entity.")
- class PersistStoreRead backend => PersistUniqueRead backend where
- getBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Unique record -> ReaderT backend m (Maybe (Entity record))
- existsBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Unique record -> ReaderT backend m Bool
- checkUnique :: forall record backend (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, PersistUniqueRead backend) => record -> ReaderT backend m (Maybe (Unique record))
- checkUniqueUpdateable :: forall record backend (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, PersistUniqueRead backend) => Entity record -> ReaderT backend m (Maybe (Unique record))
- getByValue :: forall record (m :: Type -> Type) backend. (MonadIO m, PersistUniqueRead backend, PersistRecordBackend record backend, AtLeastOneUniqueKey record) => record -> ReaderT backend m (Maybe (Entity record))
- insertBy :: forall record backend (m :: Type -> Type). (MonadIO m, PersistUniqueWrite backend, PersistRecordBackend record backend, AtLeastOneUniqueKey record, SafeToInsert record) => record -> ReaderT backend m (Either (Entity record) (Key record))
- insertUniqueEntity :: forall record backend (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, PersistUniqueWrite backend, SafeToInsert record) => record -> ReaderT backend m (Maybe (Entity record))
- onlyOneUniqueDef :: (OnlyOneUniqueKey record, Monad proxy) => proxy record -> UniqueDef
- onlyUnique :: forall record backend (m :: Type -> Type). (MonadIO m, PersistUniqueWrite backend, PersistRecordBackend record backend, OnlyOneUniqueKey record) => record -> ReaderT backend m (Unique record)
- replaceUnique :: forall record backend (m :: Type -> Type). (MonadIO m, Eq (Unique record), PersistRecordBackend record backend, PersistUniqueWrite backend) => Key record -> record -> ReaderT backend m (Maybe (Unique record))
- getEntityComments :: EntityDef -> Maybe Text
- getEntityDBName :: EntityDef -> EntityNameDB
- getEntityExtra :: EntityDef -> Map Text [[Text]]
- getEntityFields :: EntityDef -> [FieldDef]
- getEntityFieldsDatabase :: EntityDef -> [FieldDef]
- getEntityForeignDefs :: EntityDef -> [ForeignDef]
- getEntityHaskellName :: EntityDef -> EntityNameHS
- getEntityId :: EntityDef -> EntityIdDef
- getEntityIdField :: EntityDef -> Maybe FieldDef
- getEntityKeyFields :: EntityDef -> NonEmpty FieldDef
- getEntitySpan :: EntityDef -> Maybe SourceSpan
- getEntityUniques :: EntityDef -> [UniqueDef]
- getEntityUniquesNoPrimaryKey :: EntityDef -> [UniqueDef]
- isEntitySum :: EntityDef -> Bool
- overEntityFields :: ([FieldDef] -> [FieldDef]) -> EntityDef -> EntityDef
- setEntityDBName :: EntityNameDB -> EntityDef -> EntityDef
- setEntityId :: FieldDef -> EntityDef -> EntityDef
- setEntityIdDef :: EntityIdDef -> EntityDef -> EntityDef
- addFieldAttr :: FieldAttr -> FieldDef -> FieldDef
- isFieldMaybe :: FieldDef -> Bool
- isFieldNullable :: FieldDef -> IsNullable
- overFieldAttrs :: ([FieldAttr] -> [FieldAttr]) -> FieldDef -> FieldDef
- setFieldAttrs :: [FieldAttr] -> FieldDef -> FieldDef
- newtype ConstraintNameHS = ConstraintNameHS {
- unConstraintNameHS :: Text
- class DatabaseName a where
- escapeWith :: (Text -> str) -> a -> str
- newtype EntityNameHS = EntityNameHS {
- unEntityNameHS :: Text
- newtype FieldNameHS = FieldNameHS {
- unFieldNameHS :: Text
- data LiteralType
- fromPersistValueText :: PersistValue -> Either Text Text
- newtype EntityWithPrefix (prefix :: Symbol) record = EntityWithPrefix {
- unEntityWithPrefix :: Entity record
- class PersistField a => PersistFieldSql a where
- class RawSql a where
- rawSqlCols :: (Text -> Text) -> a -> (Int, [Text])
- rawSqlColCountReason :: a -> String
- rawSqlProcessRow :: [PersistValue] -> Either Text a
- unPrefix :: forall (prefix :: Symbol) record. EntityWithPrefix prefix record -> Entity record
- data BackendSpecificOverrides
- defaultAttribute :: [FieldAttr] -> Maybe Text
- emptyBackendSpecificOverrides :: BackendSpecificOverrides
- getBackendSpecificForeignKeyName :: BackendSpecificOverrides -> Maybe (EntityNameDB -> FieldNameDB -> ConstraintNameDB)
- mkColumns :: [EntityDef] -> EntityDef -> BackendSpecificOverrides -> ([Column], [UniqueDef], [ForeignDef])
- setBackendSpecificForeignKeyName :: (EntityNameDB -> FieldNameDB -> ConstraintNameDB) -> BackendSpecificOverrides -> BackendSpecificOverrides
- type CautiousMigration = [(Bool, Sql)]
- type Migration = WriterT [Text] (WriterT CautiousMigration (ReaderT SqlBackend IO)) ()
- newtype PersistUnsafeMigrationException = PersistUnsafeMigrationException [(Bool, Sql)]
- addMigration :: Bool -> Sql -> Migration
- addMigrations :: CautiousMigration -> Migration
- getMigration :: forall (m :: Type -> Type). (MonadIO m, HasCallStack) => Migration -> ReaderT SqlBackend m [Sql]
- migrate :: [EntityDef] -> EntityDef -> Migration
- parseMigration :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m (Either [Text] CautiousMigration)
- parseMigration' :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m CautiousMigration
- printMigration :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m ()
- reportError :: Text -> Migration
- reportErrors :: [Text] -> Migration
- runMigration :: forall (m :: Type -> Type). MonadIO m => Migration -> ReaderT SqlBackend m ()
- runMigrationQuiet :: forall (m :: Type -> Type). MonadIO m => Migration -> ReaderT SqlBackend m [Text]
- runMigrationSilent :: forall (m :: Type -> Type). MonadUnliftIO m => Migration -> ReaderT SqlBackend m [Text]
- runMigrationUnsafe :: forall (m :: Type -> Type). MonadIO m => Migration -> ReaderT SqlBackend m ()
- runMigrationUnsafeQuiet :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m [Text]
- runSqlCommand :: SqlPersistT IO () -> Migration
- showMigration :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m [Text]
- data FilterTablePrefix
- decorateSQLWithLimitOffset :: Text -> (Int, Int) -> Text -> Text
- filterClause :: PersistEntity val => Maybe FilterTablePrefix -> SqlBackend -> [Filter val] -> Text
- filterClauseWithVals :: PersistEntity val => Maybe FilterTablePrefix -> SqlBackend -> [Filter val] -> (Text, [PersistValue])
- orderClause :: PersistEntity val => Maybe FilterTablePrefix -> SqlBackend -> [SelectOpt val] -> Text
- fieldDBName :: PersistEntity record => EntityField record typ -> FieldNameDB
- fromSqlKey :: ToBackendKey SqlBackend record => Key record -> Int64
- getFieldName :: forall record typ (m :: Type -> Type) backend. (PersistEntity record, PersistEntityBackend record ~ SqlBackend, BackendCompatible SqlBackend backend, Monad m) => EntityField record typ -> ReaderT backend m Text
- getTableName :: forall record (m :: Type -> Type) backend. (PersistEntity record, BackendCompatible SqlBackend backend, Monad m) => record -> ReaderT backend m Text
- tableDBName :: PersistEntity record => record -> EntityNameDB
- toSqlKey :: ToBackendKey SqlBackend record => Int64 -> Key record
- withRawQuery :: forall (m :: Type -> Type) a. MonadIO m => Text -> [PersistValue] -> ConduitM [PersistValue] Void IO a -> ReaderT SqlBackend m a
- getStmtConn :: SqlBackend -> Text -> IO Statement
- rawExecute :: forall (m :: Type -> Type) backend. (MonadIO m, BackendCompatible SqlBackend backend) => Text -> [PersistValue] -> ReaderT backend m ()
- rawExecuteCount :: forall (m :: Type -> Type) backend. (MonadIO m, BackendCompatible SqlBackend backend) => Text -> [PersistValue] -> ReaderT backend m Int64
- rawQuery :: forall (m :: Type -> Type) env. (MonadResource m, MonadReader env m, BackendCompatible SqlBackend env) => Text -> [PersistValue] -> ConduitM () [PersistValue] m ()
- rawQueryRes :: forall (m1 :: Type -> Type) (m2 :: Type -> Type) env. (MonadIO m1, MonadIO m2, BackendCompatible SqlBackend env) => Text -> [PersistValue] -> ReaderT env m1 (Acquire (ConduitM () [PersistValue] m2 ()))
- rawSql :: forall a (m :: Type -> Type) backend. (RawSql a, MonadIO m, BackendCompatible SqlBackend backend) => Text -> [PersistValue] -> ReaderT backend m [a]
- acquireSqlConn :: (MonadReader backend m, BackendCompatible SqlBackend backend) => m (Acquire backend)
- acquireSqlConnWithIsolation :: (MonadReader backend m, BackendCompatible SqlBackend backend) => IsolationLevel -> m (Acquire backend)
- close' :: BackendCompatible SqlBackend backend => backend -> IO ()
- createSqlPool :: forall backend m. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> Int -> m (Pool backend)
- createSqlPoolWithConfig :: (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> ConnectionPoolConfig -> m (Pool backend)
- liftSqlPersistMPool :: forall backend m a. (MonadIO m, BackendCompatible SqlBackend backend) => ReaderT backend (NoLoggingT (ResourceT IO)) a -> Pool backend -> m a
- runSqlConn :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> backend -> m a
- runSqlConnWithIsolation :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> backend -> IsolationLevel -> m a
- runSqlPersistM :: BackendCompatible SqlBackend backend => ReaderT backend (NoLoggingT (ResourceT IO)) a -> backend -> IO a
- runSqlPersistMPool :: BackendCompatible SqlBackend backend => ReaderT backend (NoLoggingT (ResourceT IO)) a -> Pool backend -> IO a
- runSqlPool :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> m a
- runSqlPoolNoTransaction :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> m a
- runSqlPoolWithExtensibleHooks :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> SqlPoolHooks m backend -> m a
- runSqlPoolWithHooks :: forall backend m a before after onException. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> (backend -> m before) -> (backend -> m after) -> (backend -> SomeException -> m onException) -> m a
- runSqlPoolWithIsolation :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> IsolationLevel -> m a
- withSqlConn :: forall backend m a. (MonadUnliftIO m, MonadLoggerIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> (backend -> m a) -> m a
- withSqlPool :: forall backend m a. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> Int -> (Pool backend -> m a) -> m a
- withSqlPoolWithConfig :: forall backend m a. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> ConnectionPoolConfig -> (Pool backend -> m a) -> m a
- data Column = Column {
- cName :: !FieldNameDB
- cNull :: !Bool
- cSqlType :: !SqlType
- cDefault :: !(Maybe Text)
- cGenerated :: !(Maybe Text)
- cDefaultConstraintName :: !(Maybe ConstraintNameDB)
- cMaxLen :: !(Maybe Integer)
- cReference :: !(Maybe ColumnReference)
- data ColumnReference = ColumnReference {}
- type ConnectionPool = Pool SqlBackend
- data ConnectionPoolConfig = ConnectionPoolConfig {
- connectionPoolConfigStripes :: Int
- connectionPoolConfigIdleTimeout :: NominalDiffTime
- connectionPoolConfigSize :: Int
- data PersistentSqlException
- newtype Single a = Single {
- unSingle :: a
- type SqlPersistM = SqlPersistT (NoLoggingT (ResourceT IO))
- type SqlPersistT = ReaderT SqlBackend
- defaultConnectionPoolConfig :: ConnectionPoolConfig
- type IsSqlBackend backend = (IsPersistBackend backend, BaseBackend backend ~ SqlBackend)
- type SqlBackendCanRead backend = (BackendCompatible SqlBackend backend, PersistQueryRead backend, PersistStoreRead backend, PersistUniqueRead backend)
- type SqlBackendCanWrite backend = (SqlBackendCanRead backend, PersistQueryWrite backend, PersistStoreWrite backend, PersistUniqueWrite backend)
- newtype SqlReadBackend = SqlReadBackend {}
- type SqlReadT (m :: Type -> Type) a = forall backend. SqlBackendCanRead backend => ReaderT backend m a
- newtype SqlWriteBackend = SqlWriteBackend {}
- type SqlWriteT (m :: Type -> Type) a = forall backend. SqlBackendCanWrite backend => ReaderT backend m a
- readToUnknown :: forall (m :: Type -> Type) a. Monad m => ReaderT SqlReadBackend m a -> ReaderT SqlBackend m a
- readToWrite :: forall (m :: Type -> Type) a. Monad m => ReaderT SqlReadBackend m a -> ReaderT SqlWriteBackend m a
- writeToUnknown :: forall (m :: Type -> Type) a. Monad m => ReaderT SqlWriteBackend m a -> ReaderT SqlBackend m a
- data InsertSqlResult
- = ISRSingle Text
- | ISRInsertGet Text Text
- | ISRManyKeys Text [PersistValue]
- data IsolationLevel
- type LogFunc = Loc -> LogSource -> LogLevel -> LogStr -> IO ()
- data Statement = Statement {
- stmtFinalize :: IO ()
- stmtReset :: IO ()
- stmtExecute :: [PersistValue] -> IO Int64
- stmtQuery :: forall (m :: Type -> Type). MonadIO m => [PersistValue] -> Acquire (ConduitM () [PersistValue] m ())
- data Checkmark
- type Attr = Text
- data WhyNullable
- data CascadeAction
- = Cascade
- | Restrict
- | SetNull
- | SetDefault
- data CompositeDef = CompositeDef {
- compositeFields :: !(NonEmpty FieldDef)
- compositeAttrs :: ![Attr]
- data EmbedEntityDef = EmbedEntityDef {}
- data EmbedFieldDef = EmbedFieldDef {
- emFieldDB :: FieldNameDB
- emFieldEmbed :: Maybe (Either SelfEmbed EntityNameHS)
- data ReferenceDef
- data EntityDef
- data EntityIdDef
- type ExtraLine = [Text]
- data FieldType
- data FieldAttr
- = FieldAttrMaybe
- | FieldAttrNullable
- | FieldAttrMigrationOnly
- | FieldAttrSafeToRemove
- | FieldAttrNoreference
- | FieldAttrReference Text
- | FieldAttrConstraint Text
- | FieldAttrDefault Text
- | FieldAttrSqltype Text
- | FieldAttrMaxlen Integer
- | FieldAttrSql Text
- | FieldAttrOther Text
- data FieldCascade = FieldCascade {
- fcOnUpdate :: !(Maybe CascadeAction)
- fcOnDelete :: !(Maybe CascadeAction)
- data FieldDef = FieldDef {
- fieldHaskell :: !FieldNameHS
- fieldDB :: !FieldNameDB
- fieldType :: !FieldType
- fieldSqlType :: !SqlType
- fieldAttrs :: ![FieldAttr]
- fieldStrict :: !Bool
- fieldReference :: !ReferenceDef
- fieldCascade :: !FieldCascade
- fieldComments :: !(Maybe Text)
- fieldGenerated :: !(Maybe Text)
- fieldIsImplicitIdColumn :: !Bool
- data ForeignDef = ForeignDef {
- foreignRefTableHaskell :: !EntityNameHS
- foreignRefTableDBName :: !EntityNameDB
- foreignConstraintNameHaskell :: !ConstraintNameHS
- foreignConstraintNameDBName :: !ConstraintNameDB
- foreignFieldCascade :: !FieldCascade
- foreignFields :: ![(ForeignFieldDef, ForeignFieldDef)]
- foreignAttrs :: ![Attr]
- foreignNullable :: Bool
- foreignToPrimary :: Bool
- type ForeignFieldDef = (FieldNameHS, FieldNameDB)
- data UpdateException
- = KeyNotFound String
- | UpsertError String
- data PersistException
- = PersistError Text
- | PersistMarshalError Text
- | PersistInvalidField Text
- | PersistForeignConstraintUnmet Text
- | PersistMongoDBError Text
- | PersistMongoDBUnsupported Text
- entitiesPrimary :: EntityDef -> NonEmpty FieldDef
- entityPrimary :: EntityDef -> Maybe CompositeDef
- fieldAttrsContainsNullable :: [FieldAttr] -> IsNullable
- isFieldNotGenerated :: FieldDef -> Bool
- isHaskellField :: FieldDef -> Bool
- keyAndEntityFields :: EntityDef -> NonEmpty FieldDef
- keyAndEntityFieldsDatabase :: EntityDef -> NonEmpty FieldDef
- noCascade :: FieldCascade
- parseFieldAttrs :: [Text] -> [FieldAttr]
- renderCascadeAction :: CascadeAction -> Text
- renderFieldCascade :: FieldCascade -> Text
- transactionSave :: forall (m :: Type -> Type). MonadIO m => ReaderT SqlBackend m ()
- transactionSaveWithIsolation :: forall (m :: Type -> Type). MonadIO m => IsolationLevel -> ReaderT SqlBackend m ()
- transactionUndo :: forall (m :: Type -> Type). MonadIO m => ReaderT SqlBackend m ()
- transactionUndoWithIsolation :: forall (m :: Type -> Type). MonadIO m => IsolationLevel -> ReaderT SqlBackend m ()
Setup
If you're already using persistent, then you're ready to use
esqueleto, no further setup is needed. If you're just
starting a new project and would like to use esqueleto, take
a look at persistent's book first
(http://www.yesodweb.com/book/persistent) to learn how to
define your schema.
Introduction
The main goals of esqueleto are to:
- Be easily translatable to SQL. When you take a look at a
esqueletoquery, you should be able to know exactly how the SQL query will end up. (As opposed to being a relational algebra EDSL such as HaskellDB, which is non-trivial to translate into SQL.) - Support the most widely used SQL features. We'd like you to be
able to use
esqueletofor all of your queries, no exceptions. Send a pull request or open an issue on our project page (https://github.com/prowdsponsor/esqueleto) if there's anything missing that you'd like to see. - Be as type-safe as possible. We strive to provide as many type checks as possible. If you get bitten by some invalid code that type-checks, please open an issue on our project page so we can take a look.
However, it is not a goal to be able to write portable SQL.
We do not try to hide the differences between DBMSs from you,
and esqueleto code that works for one database may not work
on another. This is a compromise we have to make in order to
give you as much control over the raw SQL as possible without
losing too much convenience. This also means that you may
type-check a query that doesn't work on your DBMS.
Getting started
We like clean, easy-to-read EDSLs. However, in order to achieve this goal we've used a lot of type hackery, leading to some hard-to-read type signatures. On this section, we'll try to build some intuition about the syntax.
For the following examples, we'll use this example schema:
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persist|
Person
name String
age Int Maybe
deriving Eq Show
BlogPost
title String
authorId PersonId
deriving Eq Show
Follow
follower PersonId
followed PersonId
deriving Eq Show
|]
Most of esqueleto was created with SELECT statements in
mind, not only because they're the most common but also
because they're the most complex kind of statement. The most
simple kind of SELECT would be:
SELECT * FROM Person
In esqueleto, we may write the same query above as:
do people <-select$from$ \person -> do return person liftIO $ mapM_ (putStrLn . personName . entityVal) people
The expression above has type SqlPersist m (), while
people has type [Entity Person]. The query above will be
translated into exactly the same query we wrote manually, but
instead of SELECT * it will list all entity fields (using
* is not robust). Note that esqueleto knows that we want
an Entity Person just because of the personName that we're
printing later.
However, most of the time we need to filter our queries using
WHERE. For example:
SELECT * FROM Person WHERE Person.name = "John"
In esqueleto, we may write the same query above as:
select$from$ \p -> dowhere_(p^.PersonName==.val"John") return p
Although esqueleto's code is a bit more noisy, it's has
almost the same structure (save from the return). The
( operator is used to project a field from an entity.
The field name is the same one generated by ^.)persistent's
Template Haskell functions. We use val to lift a constant
Haskell value into the SQL query.
Another example would be:
SELECT * FROM Person WHERE Person.age >= 18
In esqueleto, we may write the same query above as:
select$from$ \p -> dowhere_(p^.PersonAge>=.just(val18)) return p
Since age is an optional Person field, we use just to lift
into val 18 :: SqlExpr (Value Int)just (.val 18) ::
SqlExpr (Value (Maybe Int))
Implicit joins are represented by tuples. For example, to get the list of all blog posts and their authors, we could write:
SELECT BlogPost.*, Person.* FROM BlogPost, Person WHERE BlogPost.authorId = Person.id ORDER BY BlogPost.title ASC
In esqueleto, we may write the same query above as:
select$from$ \(b, p) -> dowhere_(b^.BlogPostAuthorId==.p^.PersonId)orderBy[asc(b^.BlogPostTitle)] return (b, p)
However, you may want your results to include people who don't
have any blog posts as well using a LEFT OUTER JOIN:
SELECT Person.*, BlogPost.* FROM Person LEFT OUTER JOIN BlogPost ON Person.id = BlogPost.authorId ORDER BY Person.name ASC, BlogPost.title ASC
In esqueleto, we may write the same query above as:
select$from$ \(p `LeftOuterJoin` mb) -> doon(just(p^.PersonId)==.mb?.BlogPostAuthorId)orderBy[asc(p^.PersonName),asc(mb?.BlogPostTitle)] return (p, mb)
On a LEFT OUTER JOIN the entity on the right hand side may
not exist (i.e. there may be a Person without any
BlogPosts), so while p :: SqlExpr (Entity Person), we have
mb :: SqlExpr (Maybe (Entity BlogPost)). The whole
expression above has type SqlPersist m [(Entity Person, Maybe
(Entity BlogPost))]. Instead of using (^.), we used
( to project a field from a ?.)Maybe (Entity a).
We are by no means limited to joins of two tables, nor by
joins of different tables. For example, we may want a list
of the Follow entity:
SELECT P1.*, Follow.*, P2.* FROM Person AS P1 INNER JOIN Follow ON P1.id = Follow.follower INNER JOIN Person AS P2 ON P2.id = Follow.followed
In esqueleto, we may write the same query above as:
select$from$ \(p1 `InnerJoin` f `InnerJoin` p2) -> doon(p1^.PersonId==.f^.FollowFollower)on(p2^.PersonId==.f^.FollowFollowed) return (p1, f, p2)
We also currently support UPDATE and DELETE statements.
For example:
doupdate$ \p -> dosetp [ PersonName=.val"João" ]where_(p^.PersonName==.val"Joao")delete$from$ \p -> dowhere_(p^.PersonAge<.just(val14))
The results of queries can also be used for insertions.
In SQL, we might write the following, inserting a new blog
post for every user:
INSERT INTO BlogPost
SELECT ('Group Blog Post', id)
FROM Person
In esqueleto, we may write the same query above as:
insertSelect$from$ \p-> return $ BlogPost<#"Group Blog Post"<&>(p^.PersonId)
Individual insertions can be performed through Persistent's
insert function, reexported for convenience.
esqueleto's Language
on :: SqlExpr (Value Bool) -> SqlQuery () Source #
An ON clause, useful to describe how two tables are related. Cross joins
and tuple-joins do not need an on clause, but InnerJoin and the various
outer joins do.
Database.Esqueleto.Experimental in version 4.0.0.0 of the library. The
Experimental module has a dramatically improved means for introducing
tables and entities that provides more power and less potential for runtime
errors.
If you don't include an on clause (or include too many!) then a runtime
exception will be thrown.
As an example, consider this simple join:
select$from$ \(foo `InnerJoin` bar) -> doon(foo^.FooId==.bar^.BarFooId) ...
We need to specify the clause for joining the two columns together. If we had this:
select$from$ \(foo `CrossJoin` bar) -> do ...
Then we can safely omit the on clause, because the cross join will make
pairs of all records possible.
You can do multiple on clauses in a query. This query joins three tables,
and has two on clauses:
select$from$ \(foo `InnerJoin` bar `InnerJoin` baz) -> doon(baz^.BazId==.bar^.BarBazId)on(foo^.FooId==.bar^.BarFooId) ...
Old versions of esqueleto required that you provide the on clauses in
reverse order. This restriction has been lifted - you can now provide on
clauses in any order, and the SQL should work itself out. The above query is
now totally equivalent to this:
select$from$ \(foo `InnerJoin` bar `InnerJoin` baz) -> doon(foo^.FooId==.bar^.BarFooId)on(baz^.BazId==.bar^.BarBazId) ...
groupBy :: ToSomeValues a => a -> SqlQuery () Source #
GROUP BY clause. You can enclose multiple columns
in a tuple.
select $from\(foo `InnerJoin` bar) -> doon(foo^.FooBarId==.bar^.BarId)groupBy(bar^.BarId, bar^.BarName) return (bar^.BarId, bar^.BarName, countRows)
With groupBy you can sort by aggregate functions, like so
(we used let to restrict the more general countRows to
SqlSqlExpr (Value Int) to avoid ambiguity---the second use of
countRows has its type restricted by the :: Int below):
r <- select $from\(foo `InnerJoin` bar) -> doon(foo^.FooBarId==.bar^.BarId)groupBy$ bar^.BarName let countRows' =countRowsorderBy[asccountRows'] return (bar^.BarName, countRows') forM_ r $ \(Valuename,Valuecount) -> do print name print (count :: Int)
Need more columns?
The ToSomeValues class is defined for SqlExpr and tuples of SqlExprs.
We only have definitions for up to 8 elements in a tuple right now, so it's
possible that you may need to have more than 8 elements.
For example, consider a query with a groupBy call like this:
groupBy (e0, e1, e2, e3, e4, e5, e6, e7)
This is the biggest you can get with a single tuple. However, you can easily nest the tuples to add more:
groupBy ((e0, e1, e2, e3, e4, e5, e6, e7), e8, e9)
orderBy :: [SqlExpr OrderBy] -> SqlQuery () Source #
ORDER BY clause. See also asc and desc.
Multiple calls to orderBy get concatenated on the final
query, including distinctOnOrderBy.
asc :: PersistField a => SqlExpr (Value a) -> SqlExpr OrderBy Source #
Ascending order of this field or SqlExpression.
desc :: PersistField a => SqlExpr (Value a) -> SqlExpr OrderBy Source #
Descending order of this field or SqlExpression.
distinctOn :: [SqlExpr DistinctOn] -> SqlQuery a -> SqlQuery a Source #
Deprecated: This function is deprecated, as it is only supported in Postgresql. Please use the variant in PostgreSQL instead.
DISTINCT ON. Change the current SELECT into
SELECT DISTINCT ON (SqlExpressions). For example:
select $from\foo ->distinctOn[don(foo ^. FooName),don(foo ^. FooState)] $ do ...
You can also chain different calls to distinctOn. The
above is equivalent to:
select $from\foo ->distinctOn[don(foo ^. FooName)] $distinctOn[don(foo ^. FooState)] $ do ...
Each call to distinctOn adds more SqlExpressions. Calls to
distinctOn override any calls to distinct.
Note that PostgreSQL requires the SqlExpressions on DISTINCT
ON to be the first ones to appear on a ORDER BY. This is
not managed automatically by esqueleto, keeping its spirit
of trying to be close to raw SQL.
Supported by PostgreSQL only.
Since: 2.2.4
don :: SqlExpr (Value a) -> SqlExpr DistinctOn Source #
Erase an SqlExpression's type so that it's suitable to
be used by distinctOn.
Since: 2.2.4
distinctOnOrderBy :: [SqlExpr OrderBy] -> SqlQuery a -> SqlQuery a Source #
Deprecated: This function is deprecated, as it is only supported in Postgresql. Please use the function defined in PostgreSQL instead.
A convenience function that calls both distinctOn and
orderBy. In other words,
distinctOnOrderBy [asc foo, desc bar, desc quux] $ do
...
is the same as:
distinctOn[don foo, don bar, don quux] $ doorderBy[asc foo, desc bar, desc quux] ...
Since: 2.2.4
locking :: LockingKind -> SqlQuery () Source #
Add a locking clause to the query. Please read
LockingKind documentation and your RDBMS manual.
Unsafe since not all locking clauses are implemented for every RDBMS
If multiple calls to locking are made on the same query,
the last one is used.
Since: 2.2.7
(^.) :: forall typ val. (PersistEntity val, PersistField typ) => SqlExpr (Entity val) -> EntityField val typ -> SqlExpr (Value typ) infixl 9 Source #
Project a field of an entity.
(?.) :: (PersistEntity val, PersistField typ) => SqlExpr (Maybe (Entity val)) -> EntityField val typ -> SqlExpr (Value (Maybe (Nullable typ))) infixl 9 Source #
Project an EntityField of a nullable entity. The result type will be
Nullable, meaning that nested Maybe won't be produced here.
As of v3.6.0.0, this will attempt to combine nested Maybe. If you want to
keep nested Maybe, then see ??..
val :: PersistField typ => typ -> SqlExpr (Value typ) Source #
Lift a constant value from Haskell-land to the query.
isNothing :: PersistField typ => SqlExpr (Value (Maybe typ)) -> SqlExpr (Value Bool) Source #
IS NULL comparison.
For IS NOT NULL, you can negate this with not_, as in not_ (isNothing (person ^. PersonAge))
Warning: Persistent and Esqueleto have different behavior for != Nothing:
| Haskell | SQL | |
|---|---|---|
| Persistent | | IS NOT NULL |
| Esqueleto | | != NULL |
In SQL, = NULL and != NULL return NULL instead of true or false. For this reason, you very likely do not want to use in Esqueleto.
You may find these !=. Nothinghlint rules helpful to enforce this:
- error: {lhs: v Database.Esqueleto.==. Database.Esqueleto.nothing, rhs: Database.Esqueleto.isNothing v, name: Use Esqueleto's isNothing}
- error: {lhs: v Database.Esqueleto.==. Database.Esqueleto.val Nothing, rhs: Database.Esqueleto.isNothing v, name: Use Esqueleto's isNothing}
- error: {lhs: v Database.Esqueleto.!=. Database.Esqueleto.nothing, rhs: not_ (Database.Esqueleto.isNothing v), name: Use Esqueleto's not isNothing}
- error: {lhs: v Database.Esqueleto.!=. Database.Esqueleto.val Nothing, rhs: not_ (Database.Esqueleto.isNothing v), name: Use Esqueleto's not isNothing}just :: NullableFieldProjection typ typ' => SqlExpr (Value typ) -> SqlExpr (Value (Maybe typ')) Source #
Analogous to Just, promotes a value of type typ into
one of type Maybe typ. It should hold that .val . Just
=== just . val
This function will try not to produce a nested Maybe. This is in accord
with how SQL represents NULL. That means that .
This behavior was changed in v3.6.0.0. If you want to produce nested just . just = justMaybe,
see just'.
joinV :: NullableFieldProjection typ typ' => SqlExpr (Value (Maybe typ)) -> SqlExpr (Value (Maybe typ')) Source #
Join nested Maybes in a Value into one. This is useful when
calling aggregate functions on nullable fields.
As of v3.6.0.0, this function will attempt to work on both as well as SqlExpr
(Value (Maybe a))
inputs to make transitioning to SqlExpr (Value (Maybe (Maybe a)))NullableFieldProjection easier. This may
make type inference worse in some cases. If you want the monomorphic variant,
see joinV'
withNonNull :: PersistField typ => SqlExpr (Value (Maybe typ)) -> (SqlExpr (Value typ) -> SqlQuery a) -> SqlQuery a Source #
Project an SqlExpression that may be null, guarding against null cases.
countDistinct :: Num a => SqlExpr (Value typ) -> SqlExpr (Value a) Source #
COUNT(DISTINCT x).
Since: 2.4.1
(==.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 Source #
This operator produces the SQL operator =, which is used to compare
values for equality.
Example:
query :: UserId -> SqlPersistT IO [Entity User]
query userId = select $ do
user <- from $ table @User
where_ (user ^. UserId ==. val userId)
pure user
This would generate the following SQL:
SELECT user.* FROM user WHERE user.id = ?
(>=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 Source #
This operator translates to the SQL operator >=.
Example:
where_ $ user ^. UserAge >=. val 21
(>.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 Source #
This operator translates to the SQL operator >.
Example:
where_ $ user ^. UserAge >. val 20
(<=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 Source #
This operator translates to the SQL operator <=.
Example:
where_ $ val 21 <=. user ^. UserAge
(<.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 Source #
This operator translates to the SQL operator <.
Example:
where_ $ val 20 <. user ^. UserAge
(!=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 Source #
(&&.) :: SqlExpr (Value Bool) -> SqlExpr (Value Bool) -> SqlExpr (Value Bool) infixr 3 Source #
This operator translates to the SQL operator AND.
Example:
where_ $
user ^. UserName ==. val Matt
&&. user ^. UserAge >=. val 21
between :: PersistField a => SqlExpr (Value a) -> (SqlExpr (Value a), SqlExpr (Value a)) -> SqlExpr (Value Bool) Source #
a translates to the SQL expression between (b, c)a >= b AND a <= c.
It does not use a SQL BETWEEN operator.
@since: 3.1.0
(+.) :: PersistField a => SqlExpr (Value a) -> SqlExpr (Value a) -> SqlExpr (Value a) infixl 6 Source #
This operator translates to the SQL operator +.
This does not require or assume anything about the SQL values. Interpreting
what +. means for a given type is left to the database engine.
Example:
user ^. UserAge +. val 10
(-.) :: PersistField a => SqlExpr (Value a) -> SqlExpr (Value a) -> SqlExpr (Value a) infixl 6 Source #
This operator translates to the SQL operator -.
This does not require or assume anything about the SQL values. Interpreting
what -. means for a given type is left to the database engine.
Example:
user ^. UserAge -. val 10
(/.) :: PersistField a => SqlExpr (Value a) -> SqlExpr (Value a) -> SqlExpr (Value a) infixl 7 Source #
This operator translates to the SQL operator /.
This does not require or assume anything about the SQL values. Interpreting
what /. means for a given type is left to the database engine.
Example:
user ^. UserAge /. val 10
(*.) :: PersistField a => SqlExpr (Value a) -> SqlExpr (Value a) -> SqlExpr (Value a) infixl 7 Source #
This operator translates to the SQL operator *.
This does not require or assume anything about the SQL values. Interpreting
what *. means for a given type is left to the database engine.
Example:
user ^. UserAge *. val 10
round_ :: (PersistField a, Num a, PersistField b, Num b) => SqlExpr (Value a) -> SqlExpr (Value b) Source #
ceiling_ :: (PersistField a, Num a, PersistField b, Num b) => SqlExpr (Value a) -> SqlExpr (Value b) Source #
floor_ :: (PersistField a, Num a, PersistField b, Num b) => SqlExpr (Value a) -> SqlExpr (Value b) Source #
sum_ :: (PersistField a, PersistField b) => SqlExpr (Value a) -> SqlExpr (Value (Maybe b)) Source #
avg_ :: (PersistField a, PersistField b) => SqlExpr (Value a) -> SqlExpr (Value (Maybe b)) Source #
castNum :: (Num a, Num b) => SqlExpr (Value a) -> SqlExpr (Value b) Source #
Allow a number of one type to be used as one of another type via an implicit cast. An explicit cast is not made, this function changes only the types on the Haskell side.
Caveat: Trying to use castNum from Double to Int
will not result in an integer, the original fractional
number will still be used! Use round_, ceiling_ or
floor_ instead.
Safety: This operation is mostly safe due to the Num
constraint between the types and the fact that RDBMSs
usually allow numbers of different types to be used
interchangeably. However, there may still be issues with
the query not being accepted by the RDBMS or persistent
not being able to parse it.
Since: 2.2.9
castNumM :: (Num a, Num b) => SqlExpr (Value (Maybe a)) -> SqlExpr (Value (Maybe b)) Source #
Same as castNum, but for nullable values.
Since: 2.2.9
coalesce :: (PersistField a, NullableFieldProjection a a') => [SqlExpr (Value (Maybe a))] -> SqlExpr (Value (Maybe a')) Source #
COALESCE function. Evaluates the arguments in order and
returns the value of the first non-NULL SqlExpression, or NULL
(Nothing) otherwise. Some RDBMSs (such as SQLite) require
at least two arguments; please refer to the appropriate
documentation.
Since: 1.4.3
coalesceDefault :: PersistField a => [SqlExpr (Value (Maybe a))] -> SqlExpr (Value a) -> SqlExpr (Value a) Source #
Like coalesce, but takes a non-nullable SqlExpression
placed at the end of the SqlExpression list, which guarantees
a non-NULL result.
Since: 1.4.3
upper_ :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s) Source #
UPPER function.
@since 3.3.0
ltrim_ :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s) Source #
LTRIM function.
@since 3.3.0
rtrim_ :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s) Source #
RTRIM function.
@since 3.3.0
length_ :: (SqlString s, Num a) => SqlExpr (Value s) -> SqlExpr (Value a) Source #
LENGTH function.
@since 3.3.0
left_ :: (SqlString s, Num a) => (SqlExpr (Value s), SqlExpr (Value a)) -> SqlExpr (Value s) Source #
LEFT function.
@since 3.3.0
right_ :: (SqlString s, Num a) => (SqlExpr (Value s), SqlExpr (Value a)) -> SqlExpr (Value s) Source #
RIGHT function.
@since 3.3.0
like :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s) -> SqlExpr (Value Bool) infixr 2 Source #
LIKE operator.
ilike :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s) -> SqlExpr (Value Bool) infixr 2 Source #
Deprecated: Since 3.6.0: ilike is only supported on Postgres. Please import it from 'Database.Esqueleto.PostgreSQL.
ILIKE operator (case-insensitive LIKE).
Supported by PostgreSQL only. Deprecated in version 3.6.0 in favor of the version available from Database.Esqueleto.PostgreSQL.
Since: 2.2.3
concat_ :: SqlString s => [SqlExpr (Value s)] -> SqlExpr (Value s) Source #
The CONCAT function with a variable number of
parameters. Supported by MySQL and PostgreSQL. SQLite supports this in
versions after 3.44.0, and persistent-sqlite supports this in versions
2.13.3.0 and after.
(++.) :: SqlString s => SqlExpr (Value s) -> SqlExpr (Value s) -> SqlExpr (Value s) infixr 5 Source #
The || string concatenation operator (named after
Haskell's ++ in order to avoid naming clash with ||.).
Supported by SQLite and PostgreSQL.
MySQL support requires setting the SQL mode to PIPES_AS_CONCAT or ANSI
- see this StackOverflow answer.
castString :: (SqlString s, SqlString r) => SqlExpr (Value s) -> SqlExpr (Value r) Source #
Cast a string type into Text. This function
is very useful if you want to use newtypes, or if you want
to apply functions such as like to strings of different
types.
Safety: This is a slightly unsafe function, especially if
you have defined your own instances of SqlString. Also,
since Maybe is an instance of SqlString, it's possible
to turn a nullable value into a non-nullable one. Avoid
using this function if possible.
subList_select :: PersistField a => SqlQuery (SqlExpr (Value a)) -> SqlExpr (ValueList a) Source #
Execute a subquery SELECT in an SqlExpression. Returns a
list of values.
valList :: PersistField typ => [typ] -> SqlExpr (ValueList typ) Source #
Lift a list of constant value from Haskell-land to the query.
justList :: SqlExpr (ValueList typ) -> SqlExpr (ValueList (Maybe typ)) Source #
Same as just but for ValueList. Most of the time you
won't need it, though, because you can use just from
inside subList_select or Just from inside valList.
Since: 2.2.12
in_ :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (ValueList typ) -> SqlExpr (Value Bool) Source #
IN operator. For example if you want to select all Persons by a list
of IDs:
SELECT * FROM Person WHERE Person.id IN (?)
In esqueleto, we may write the same query above as:
select $from$ \person -> dowhere_$ person^.PersonId `in_`valListpersonIds return person
Where personIds is of type [Key Person].
notIn :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (ValueList typ) -> SqlExpr (Value Bool) Source #
NOT IN operator.
set :: PersistEntity val => SqlExpr (Entity val) -> [SqlExpr (Entity val) -> SqlExpr Update] -> SqlQuery () Source #
SET clause used on UPDATEs. Note that while it's not
a type error to use this function on a SELECT, it will
most certainly result in a runtime error.
(=.) :: (PersistEntity val, PersistField typ) => EntityField val typ -> SqlExpr (Value typ) -> SqlExpr (Entity val) -> SqlExpr Update infixr 3 Source #
(+=.) :: (PersistEntity val, PersistField a) => EntityField val a -> SqlExpr (Value a) -> SqlExpr (Entity val) -> SqlExpr Update infixr 3 Source #
(-=.) :: (PersistEntity val, PersistField a) => EntityField val a -> SqlExpr (Value a) -> SqlExpr (Entity val) -> SqlExpr Update infixr 3 Source #
(*=.) :: (PersistEntity val, PersistField a) => EntityField val a -> SqlExpr (Value a) -> SqlExpr (Entity val) -> SqlExpr Update infixr 3 Source #
(/=.) :: (PersistEntity val, PersistField a) => EntityField val a -> SqlExpr (Value a) -> SqlExpr (Entity val) -> SqlExpr Update infixr 3 Source #
case_ :: PersistField a => [(SqlExpr (Value Bool), SqlExpr (Value a))] -> SqlExpr (Value a) -> SqlExpr (Value a) Source #
CASE statement. For example:
select $ return $case_[when_(exists$from$ \p -> dowhere_(p^.PersonName==.val"Mike"))then_(subSelect$from$ \v -> do let sub =from$ \c -> dowhere_(c^.PersonName==.val"Mike") return (c^.PersonFavNum)where_(just(v^.PersonFavNum) >.subSelectsub) return $count(v^.PersonName) +.val(1 :: Int)) ] (else_$val(-1))
This query is a bit complicated, but basically it checks if a person
named "Mike" exists, and if that person does, run the subquery to find
out how many people have a ranking (by Fav Num) higher than "Mike".
NOTE: There are a few things to be aware about this statement.
- This only implements the full CASE statement, it does not implement the "simple" CASE statement.
- At least one
when_andthen_is mandatory otherwise it will emit an error. - The
else_is also mandatory, unlike the SQL statement in which if theELSEis omitted it will return aNULL. You can reproduce this vianothing.
Since: 2.1.2
toBaseId :: ToBaseId ent => SqlExpr (Value (Key ent)) -> SqlExpr (Value (Key (BaseEnt ent))) Source #
Convert an entity's key into another entity's.
This function is to be used when you change an entity's Id to be
that of another entity. For example:
Bar barNum Int Foo bar BarId fooNum Int Primary bar
In this example, Bar is said to be the BaseEnt(ity), and Foo the child. To model this in Esqueleto, declare:
instance ToBaseId Foo where type BaseEnt Foo = Bar toBaseIdWitness barId = FooKey barId
Now you're able to write queries such as:
select$from$ (bar `InnerJoin` foo) -> doon(toBaseId(foo^.FooId)==.bar^.BarId) return (bar, foo)
Note: this function may be unsafe to use in conditions not like the one of the example above.
Since: 2.4.3
fromBaseId :: ToBaseId ent => SqlExpr (Value (Key (BaseEnt ent))) -> SqlExpr (Value (Key ent)) Source #
The inverse of toBaseId. Note that this is somewhat less "safe" than
toBaseId. Calling toBaseId will usually mean that a foreign key
constraint is present that guarantees the presence of the base ID.
fromBaseId has no such guarantee. Consider the code example given in
toBaseId:
Bar barNum Int Foo bar BarId fooNum Int Primary bar
instance ToBaseId Foo where type BaseEnt Foo = Bar toBaseIdWitness barId = FooKey barId
The type of toBaseId for Foo would be:
toBaseId :: SqlExpr (Value FooId) -> SqlExpr (Value BarId)
The foreign key constraint on Foo means that every FooId points to
a BarId in the database. However, fromBaseId will not have this:
fromBaseId :: SqlExpr (Value BarId) -> SqlExpr (Value FooId)
Since: 3.6.0.0
fromBaseIdMaybe :: ToBaseId ent => SqlExpr (Value (Maybe (Key (BaseEnt ent)))) -> SqlExpr (Value (Maybe (Key ent))) Source #
As fromBaseId, but works on Maybe keys.
Since: 3.6.0.0
toBaseIdMaybe :: ToBaseId ent => SqlExpr (Value (Maybe (Key ent))) -> SqlExpr (Value (Maybe (Key (BaseEnt ent)))) Source #
Like toBaseId, but works on Maybe keys.
Since: 3.6.0.0
subSelect :: (PersistField a, NullableFieldProjection a a') => SqlQuery (SqlExpr (Value a)) -> SqlExpr (Value (Maybe a')) Source #
Execute a subquery SELECT in a SqlExpr. The query passed to this
function will only return a single result - it has a LIMIT 1 passed in to
the query to make it safe, and the return type is Maybe to indicate that
the subquery might result in 0 rows.
If you find yourself writing , then consider using
joinV . subSelectsubSelectMaybe.
If you're performing a countRows, then you can use subSelectCount which
is safe.
If you know that the subquery will always return exactly one row (eg
a foreign key constraint guarantees that you'll get exactly one row), then
consider subSelectUnsafe, along with a comment explaining why it is safe.
Since: 3.2.0
subSelectMaybe :: PersistField a => SqlQuery (SqlExpr (Value (Maybe a))) -> SqlExpr (Value (Maybe a)) Source #
Execute a subquery SELECT in a SqlExpr. This function is a shorthand
for the common idiom, where you are calling
joinV . subSelectsubSelect on an expression that would be Maybe already.
As an example, you would use this function when calling sum_ or max_,
which have Maybe in the result type (for a 0 row query).
Since: 3.2.0
subSelectCount :: (Num a, PersistField a) => SqlQuery ignored -> SqlExpr (Value a) Source #
Performs a COUNT of the given query in a subSelect manner. This is
always guaranteed to return a result value, and is completely safe.
Since: 3.2.0
Arguments
| :: (BackendCompatible SqlBackend (PersistEntityBackend val1), PersistEntity val1, PersistEntity val2, PersistField a) | |
| => SqlExpr (Entity val2) | An expression representing the table you have access to now. |
| -> EntityField val2 (Key val1) | The foreign key field on the table. |
| -> (SqlExpr (Entity val1) -> SqlExpr (Value a)) | A function to extract a value from the foreign reference table. |
| -> SqlExpr (Value a) |
Performs a sub-select using the given foreign key on the entity. This is useful to extract values that are known to be present by the database schema.
As an example, consider the following persistent definition:
User profile ProfileId Profile name Text
The following query will return the name of the user.
getUserWithName =
select $
from $ user ->
pure (user, subSelectForeign user UserProfile (^. ProfileName)
Since: 3.2.0
subSelectList :: PersistField a => SqlQuery (SqlExpr (Value a)) -> SqlExpr (ValueList a) Source #
Execute a subquery SELECT in a SqlExpr that returns a list. This is an
alias for subList_select and is provided for symmetry with the other safe
subselect functions.
Since: 3.2.0
subSelectUnsafe :: PersistField a => SqlQuery (SqlExpr (Value a)) -> SqlExpr (Value a) Source #
Execute a subquery SELECT in a SqlExpr. This function is unsafe,
because it can throw runtime exceptions in two cases:
- If the query passed has 0 result rows, then it will return a
NULLvalue. Thepersistentparsing operations will fail on an unexpectedNULL. - If the query passed returns more than one row, then the SQL engine will fail with an error like "More than one row returned by a subquery used as an expression".
This function is safe if you guarantee that exactly one row will be returned,
or if the result already has a Maybe type for some reason.
For variants with the safety encoded already, see subSelect and
subSelectMaybe. For the most common safe use of this, see subSelectCount.
Since: 3.2.0
when_ :: expr (Value Bool) -> () -> expr a -> (expr (Value Bool), expr a) Source #
Syntax sugar for case_.
Since: 2.1.2
from :: From a => (a -> SqlQuery b) -> SqlQuery b Source #
FROM clause: bring entities into scope.
Note that this function will be replaced by the one in
Database.Esqueleto.Experimental in version 4.0.0.0 of the library. The
Experimental module has a dramatically improved means for introducing
tables and entities that provides more power and less potential for runtime
errors.
This function internally uses two type classes in order to provide some flexibility of how you may call it. Internally we refer to these type classes as the two different magics.
The innermost magic allows you to use from with the
following types:
expr (Entity val), which brings a single entity into scope.expr (Maybe (Entity val)), which brings a single entity that may beNULLinto scope. Used forOUTER JOINs.- A
JOINof any other two types allowed by the innermost magic, where aJOINmay be anInnerJoin, aCrossJoin, aLeftOuterJoin, aRightOuterJoin, or aFullOuterJoin. TheJOINshave left fixity.
The outermost magic allows you to use from on any tuples of
types supported by innermost magic (and also tuples of tuples,
and so on), up to 8-tuples.
Note that using from for the same entity twice does work and
corresponds to a self-join. You don't even need to use two
different calls to from, you may use a JOIN or a tuple.
The following are valid examples of uses of from (the types
of the arguments of the lambda are inside square brackets):
from$ \person -> ...from$ \(person, blogPost) -> ...from$ \(p `LeftOuterJoin` mb) -> ...from$ \(p1 `InnerJoin` f `InnerJoin` p2) -> ...from$ \((p1 `InnerJoin` f) `InnerJoin` p2) -> ...
The types of the arguments to the lambdas above are, respectively:
person
:: ( Esqueleto query expr backend
, PersistEntity Person
, PersistEntityBackend Person ~ backend
) => expr (Entity Person)
(person, blogPost)
:: (...) => (expr (Entity Person), expr (Entity BlogPost))
(p `LeftOuterJoin` mb)
:: (...) => InnerJoin (expr (Entity Person)) (expr (Maybe (Entity BlogPost)))
(p1 `InnerJoin` f `InnerJoin` p2)
:: (...) => InnerJoin
(InnerJoin (expr (Entity Person))
(expr (Entity Follow)))
(expr (Entity Person))
(p1 `InnerJoin` (f `InnerJoin` p2)) ::
:: (...) => InnerJoin
(expr (Entity Person))
(InnerJoin (expr (Entity Follow))
(expr (Entity Person)))
Note that some backends may not support all kinds of JOINs.
A single value (as opposed to a whole entity). You may use
( or ^.)( to get a ?.)Value from an Entity.
Instances
| Applicative Value Source # | |
| Functor Value Source # | |
| Monad Value Source # | |
| Foldable Value Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods fold :: Monoid m => Value m -> m foldMap :: Monoid m => (a -> m) -> Value a -> m foldMap' :: Monoid m => (a -> m) -> Value a -> m foldr :: (a -> b -> b) -> b -> Value a -> b foldr' :: (a -> b -> b) -> b -> Value a -> b foldl :: (b -> a -> b) -> b -> Value a -> b foldl' :: (b -> a -> b) -> b -> Value a -> b foldr1 :: (a -> a -> a) -> Value a -> a foldl1 :: (a -> a -> a) -> Value a -> a elem :: Eq a => a -> Value a -> Bool maximum :: Ord a => Value a -> a | |
| Traversable Value Source # | |
| (PersistEntity rec, PersistField typ, SymbolToField sym rec typ) => HasField (sym :: Symbol) (SqlExpr (Entity rec)) (SqlExpr (Value typ)) Source # | This instance allows you to use Example: -- persistent model:
BlogPost
authorId PersonId
title Text
-- query:
This is exactly equivalent to the following: blogPost :: SqlExpr (Entity BlogPost) blogPost ^. BlogPostTitle blogPost ^. #title blogPost.title There's another instance defined on Since: 3.5.4.0 |
| (PersistEntity rec, PersistField typ, PersistField typ', SymbolToField sym rec typ, NullableFieldProjection typ typ', HasField sym (SqlExpr (Maybe (Entity rec))) (SqlExpr (Value (Maybe typ')))) => HasField (sym :: Symbol) (SqlExpr (Maybe (Entity rec))) (SqlExpr (Value (Maybe typ'))) Source # | This instance allows you to use Example: -- persistent model:
Person
name Text
BlogPost
title Text
authorId PersonId
-- query:
The following forms are all equivalent: blogPost :: SqlExpr (Maybe (Entity BlogPost)) blogPost ?. BlogPostTitle blogPost ?. #title blogPost.title Since: 3.5.4.0 |
| (ToFrom a a', SqlSelect b r, ToAlias b, ToAliasReference b, d ~ (a' :& b)) => DoInnerJoin Lateral a (a' -> SqlQuery b, d -> SqlExpr (Value Bool)) d Source # | |
Defined in Database.Esqueleto.Experimental.From.Join | |
| (ToFrom a a', ToMaybe b, d ~ (a' :& ToMaybeT b), SqlSelect b r, ToAlias b, ToAliasReference b) => DoLeftJoin Lateral a (a' -> SqlQuery b, d -> SqlExpr (Value Bool)) d Source # | |
Defined in Database.Esqueleto.Experimental.From.Join | |
| ToAlias (SqlExpr (Value a)) Source # | |
| ToAliasReference (SqlExpr (Value a)) Source # | |
| ToMaybe (SqlExpr (Value a)) Source # | |
Defined in Database.Esqueleto.Experimental.ToMaybe | |
| ToSomeValues (SqlExpr (Value a)) Source # | |
Defined in Database.Esqueleto.Internal.Internal | |
| Show a => Show (Value a) Source # | |
| Eq a => Eq (Value a) Source # | |
| Ord a => Ord (Value a) Source # | |
Defined in Database.Esqueleto.Internal.Internal | |
| PersistField a => SqlSelect (SqlExpr (Value a)) (Value a) Source # | You may return any single value (i.e. a single column) from
a |
Defined in Database.Esqueleto.Internal.Internal Methods sqlSelectCols :: IdentInfo -> SqlExpr (Value a) -> (Builder, [PersistValue]) Source # sqlSelectColCount :: Proxy (SqlExpr (Value a)) -> Int Source # sqlSelectProcessRow :: [PersistValue] -> Either Text (Value a) Source # sqlInsertInto :: IdentInfo -> SqlExpr (Value a) -> (Builder, [PersistValue]) Source # | |
| type ToMaybeT (SqlExpr (Value a)) Source # | |
A list of single values. There's a limited set of functions
able to work with this data type (such as subList_select,
valList, in_ and exists).
Constructors
| ValueList a |
Instances
| Show a => Show (ValueList a) Source # | |
| Eq a => Eq (ValueList a) Source # | |
| Ord a => Ord (ValueList a) Source # | |
Defined in Database.Esqueleto.Internal.Internal | |
data DistinctOn Source #
Phantom type used by distinctOn and don.
data LockingKind Source #
Different kinds of locking clauses supported by locking.
Note that each RDBMS has different locking support. The
constructors of this datatype specify only the syntax of the
locking mechanism, not its semantics. For example, even
though both MySQL and PostgreSQL support ForUpdate, there
are no guarantees that they will behave the same.
Since: 2.2.7
Constructors
| ForUpdate | Deprecated: The constructors for
Since: 2.2.7 |
| ForUpdateSkipLocked | Deprecated: The constructors for
Since: 2.2.7 |
| ForShare | Deprecated: The constructors for
Since: 2.2.7 |
| LockInShareMode | Deprecated: The constructors for
Since: 2.2.7 |
class LockableEntity a where Source #
Lockable entity
Example use:
select $ do
(p :& bp) <- from $
table Person
innerJoin table BlogPost
on do
(p :& bp) -> p ^. PersonId ==. b ^. BlogPostAuthorId
forUpdateOf (p :& b) skipLocked
return p
Methods
flattenLockableEntity :: a -> NonEmpty LockableSqlExpr Source #
Instances
| PersistEntity val => LockableEntity (SqlExpr (Entity val)) Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods flattenLockableEntity :: SqlExpr (Entity val) -> NonEmpty LockableSqlExpr Source # | |
| (LockableEntity a, LockableEntity b) => LockableEntity (a :& b) Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods flattenLockableEntity :: (a :& b) -> NonEmpty LockableSqlExpr Source # | |
class PersistField a => SqlString a Source #
Phantom class of data types that are treated as strings by the RDBMS. It has no methods because it's only used to avoid type errors such as trying to concatenate integers.
If you have a custom data type or newtype, feel free to make
it an instance of this class.
Since: 2.4.0
Instances
| SqlString Html Source # | Since: 2.3.0 |
Defined in Database.Esqueleto.Internal.Internal | |
| SqlString ByteString Source # | Since: 2.3.0 |
Defined in Database.Esqueleto.Internal.Internal | |
| SqlString Text Source # | Since: 2.3.0 |
Defined in Database.Esqueleto.Internal.Internal | |
| SqlString Text Source # | Since: 2.3.0 |
Defined in Database.Esqueleto.Internal.Internal | |
| SqlString a => SqlString (Maybe a) Source # | Since: 2.4.0 |
Defined in Database.Esqueleto.Internal.Internal | |
| a ~ Char => SqlString [a] Source # | Since: 2.3.0 |
Defined in Database.Esqueleto.Internal.Internal | |
Joins
data InnerJoin a b infixl 2 Source #
Data type that represents an INNER JOIN (see LeftOuterJoin for an example).
Constructors
| a `InnerJoin` b infixl 2 |
Instances
| IsJoinKind InnerJoin Source # | |
Defined in Database.Esqueleto.Internal.Internal | |
| FromPreprocess (InnerJoin a b) => From (InnerJoin a b) Source # | |
| (DoInnerJoin lateral lhs rhs r, lateral ~ IsLateral rhs) => ToFrom (InnerJoin lhs rhs) r Source # | |
data CrossJoin a b infixl 2 Source #
Data type that represents a CROSS JOIN (see LeftOuterJoin for an example).
Constructors
| a `CrossJoin` b infixl 2 |
Instances
| IsJoinKind CrossJoin Source # | |
Defined in Database.Esqueleto.Internal.Internal | |
| FromPreprocess (CrossJoin a b) => From (CrossJoin a b) Source # | |
| (DoCrossJoin lateral lhs rhs r, IsLateral rhs ~ lateral) => ToFrom (CrossJoin lhs rhs) r Source # | |
data LeftOuterJoin a b infixl 2 Source #
Data type that represents a LEFT OUTER JOIN. For example,
select $from$ \(person `LeftOuterJoin` pet) -> ...
is translated into
SELECT ... FROM Person LEFT OUTER JOIN Pet ...
See also: from.
Constructors
| a `LeftOuterJoin` b infixl 2 |
Instances
| IsJoinKind LeftOuterJoin Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods smartJoin :: a -> b -> LeftOuterJoin a b Source # reifyJoinKind :: LeftOuterJoin a b -> JoinKind Source # | |
| FromPreprocess (LeftOuterJoin a b) => From (LeftOuterJoin a b) Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods from_ :: SqlQuery (LeftOuterJoin a b) Source # | |
| (DoLeftJoin lateral lhs rhs r, lateral ~ IsLateral rhs) => ToFrom (LeftOuterJoin lhs rhs) r Source # | |
Defined in Database.Esqueleto.Experimental.From.Join Methods toFrom :: LeftOuterJoin lhs rhs -> From r Source # | |
data RightOuterJoin a b infixl 2 Source #
Data type that represents a RIGHT OUTER JOIN (see LeftOuterJoin for an example).
Constructors
| a `RightOuterJoin` b infixl 2 |
Instances
| IsJoinKind RightOuterJoin Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods smartJoin :: a -> b -> RightOuterJoin a b Source # reifyJoinKind :: RightOuterJoin a b -> JoinKind Source # | |
| FromPreprocess (RightOuterJoin a b) => From (RightOuterJoin a b) Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods from_ :: SqlQuery (RightOuterJoin a b) Source # | |
| (ToFrom a a', ToFrom b b', ToMaybe a', ToMaybeT a' ~ ma, HasOnClause rhs (ma :& b'), ErrorOnLateral b, rhs ~ (b, (ma :& b') -> SqlExpr (Value Bool))) => ToFrom (RightOuterJoin a rhs) (ma :& b') Source # | |
Defined in Database.Esqueleto.Experimental.From.Join | |
data FullOuterJoin a b infixl 2 Source #
Data type that represents a FULL OUTER JOIN (see LeftOuterJoin for an example).
Constructors
| a `FullOuterJoin` b infixl 2 |
Instances
| IsJoinKind FullOuterJoin Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods smartJoin :: a -> b -> FullOuterJoin a b Source # reifyJoinKind :: FullOuterJoin a b -> JoinKind Source # | |
| FromPreprocess (FullOuterJoin a b) => From (FullOuterJoin a b) Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods from_ :: SqlQuery (FullOuterJoin a b) Source # | |
| (ToFrom a a', ToFrom b b', ToMaybe a', ToMaybeT a' ~ ma, ToMaybe b', ToMaybeT b' ~ mb, HasOnClause rhs (ma :& mb), ErrorOnLateral b, rhs ~ (b, (ma :& mb) -> SqlExpr (Value Bool))) => ToFrom (FullOuterJoin a rhs) (ma :& mb) Source # | |
Defined in Database.Esqueleto.Experimental.From.Join | |
(Internal) A kind of JOIN.
Constructors
| InnerJoinKind | INNER JOIN |
| CrossJoinKind | CROSS JOIN |
| LeftOuterJoinKind | LEFT OUTER JOIN |
| RightOuterJoinKind | RIGHT OUTER JOIN |
| FullOuterJoinKind | FULL OUTER JOIN |
data OnClauseWithoutMatchingJoinException Source #
Exception thrown whenever on is used to create an ON
clause but no matching JOIN is found.
Constructors
| OnClauseWithoutMatchingJoinException String |
Instances
SQL backend
SQL backend for esqueleto using SqlPersistT.
Instances
An expression on the SQL backend.
Raw expression: Contains a SqlExprMeta and a function for
building the expr. It recieves a parameter telling it whether
it is in a parenthesized context, and takes information about the SQL
connection (mainly for escaping names) and returns both an
string (Builder) and a list of values to be
interpolated by the SQL backend.
Instances
| (TypeError SqlExprFunctorMessage :: Constraint) => Functor SqlExpr Source # | Folks often want the ability to promote a Haskell function into the
fmap :: (a -> b) -> This type signature is making a pretty strong claim: "Give me a Haskell
function from Let's suppose we *could* do this - This is why If you do have a SQL function, then you can provide a safe type and introduce
it with Since: 3.5.8.2 |
| (PersistEntity rec, PersistField typ, SymbolToField sym rec typ) => HasField (sym :: Symbol) (SqlExpr (Entity rec)) (SqlExpr (Value typ)) Source # | This instance allows you to use Example: -- persistent model:
BlogPost
authorId PersonId
title Text
-- query:
This is exactly equivalent to the following: blogPost :: SqlExpr (Entity BlogPost) blogPost ^. BlogPostTitle blogPost ^. #title blogPost.title There's another instance defined on Since: 3.5.4.0 |
| (PersistEntity rec, PersistField typ, PersistField typ', SymbolToField sym rec typ, NullableFieldProjection typ typ', HasField sym (SqlExpr (Maybe (Entity rec))) (SqlExpr (Value (Maybe typ')))) => HasField (sym :: Symbol) (SqlExpr (Maybe (Entity rec))) (SqlExpr (Value (Maybe typ'))) Source # | This instance allows you to use Example: -- persistent model:
Person
name Text
BlogPost
title Text
authorId PersonId
-- query:
The following forms are all equivalent: blogPost :: SqlExpr (Maybe (Entity BlogPost)) blogPost ?. BlogPostTitle blogPost ?. #title blogPost.title Since: 3.5.4.0 |
| (ToFrom a a', SqlSelect b r, ToAlias b, ToAliasReference b, d ~ (a' :& b)) => DoInnerJoin Lateral a (a' -> SqlQuery b, d -> SqlExpr (Value Bool)) d Source # | |
Defined in Database.Esqueleto.Experimental.From.Join | |
| (ToFrom a a', ToMaybe b, d ~ (a' :& ToMaybeT b), SqlSelect b r, ToAlias b, ToAliasReference b) => DoLeftJoin Lateral a (a' -> SqlQuery b, d -> SqlExpr (Value Bool)) d Source # | |
Defined in Database.Esqueleto.Experimental.From.Join | |
| ToAlias (SqlExpr (Value a)) Source # | |
| ToAlias (SqlExpr (Entity a)) Source # | |
| ToAlias (SqlExpr (Maybe (Entity a))) Source # | |
| ToAliasReference (SqlExpr (Value a)) Source # | |
| ToAliasReference (SqlExpr (Entity a)) Source # | |
| ToAliasReference (SqlExpr (Maybe (Entity a))) Source # | |
| ToMaybe (SqlExpr (Value a)) Source # | |
Defined in Database.Esqueleto.Experimental.ToMaybe | |
| ToMaybe (SqlExpr (Entity a)) Source # | |
| ToMaybe (SqlExpr (Maybe a)) Source # | |
| FromPreprocess (SqlExpr (Entity val)) => From (SqlExpr (Entity val)) Source # | |
| FromPreprocess (SqlExpr (Maybe (Entity val))) => From (SqlExpr (Maybe (Entity val))) Source # | |
| (PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val)) => FromPreprocess (SqlExpr (Entity val)) Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods fromPreprocess :: SqlQuery (PreprocessedFrom (SqlExpr (Entity val))) Source # | |
| (PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val)) => FromPreprocess (SqlExpr (Maybe (Entity val))) Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods fromPreprocess :: SqlQuery (PreprocessedFrom (SqlExpr (Maybe (Entity val)))) Source # | |
| PersistEntity val => LockableEntity (SqlExpr (Entity val)) Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods flattenLockableEntity :: SqlExpr (Entity val) -> NonEmpty LockableSqlExpr Source # | |
| ToSomeValues (SqlExpr (Value a)) Source # | |
Defined in Database.Esqueleto.Internal.Internal | |
| a ~ Value b => UnsafeSqlFunctionArgument (SqlExpr a) Source # | |
| PersistEntity ent => ToFrom (Table ent) (SqlExpr (Entity ent)) Source # | |
| PersistEntity e => SqlSelect (SqlExpr (Insertion e)) (Insertion e) Source # |
|
Defined in Database.Esqueleto.Internal.Internal Methods sqlSelectCols :: IdentInfo -> SqlExpr (Insertion e) -> (Builder, [PersistValue]) Source # sqlSelectColCount :: Proxy (SqlExpr (Insertion e)) -> Int Source # sqlSelectProcessRow :: [PersistValue] -> Either Text (Insertion e) Source # sqlInsertInto :: IdentInfo -> SqlExpr (Insertion e) -> (Builder, [PersistValue]) Source # | |
| PersistField a => SqlSelect (SqlExpr (Value a)) (Value a) Source # | You may return any single value (i.e. a single column) from
a |
Defined in Database.Esqueleto.Internal.Internal Methods sqlSelectCols :: IdentInfo -> SqlExpr (Value a) -> (Builder, [PersistValue]) Source # sqlSelectColCount :: Proxy (SqlExpr (Value a)) -> Int Source # sqlSelectProcessRow :: [PersistValue] -> Either Text (Value a) Source # sqlInsertInto :: IdentInfo -> SqlExpr (Value a) -> (Builder, [PersistValue]) Source # | |
| PersistEntity a => SqlSelect (SqlExpr (Entity a)) (Entity a) Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods sqlSelectCols :: IdentInfo -> SqlExpr (Entity a) -> (Builder, [PersistValue]) Source # sqlSelectColCount :: Proxy (SqlExpr (Entity a)) -> Int Source # sqlSelectProcessRow :: [PersistValue] -> Either Text (Entity a) Source # sqlInsertInto :: IdentInfo -> SqlExpr (Entity a) -> (Builder, [PersistValue]) Source # | |
| PersistEntity a => SqlSelect (SqlExpr (Maybe (Entity a))) (Maybe (Entity a)) Source # | |
Defined in Database.Esqueleto.Internal.Internal Methods sqlSelectCols :: IdentInfo -> SqlExpr (Maybe (Entity a)) -> (Builder, [PersistValue]) Source # sqlSelectColCount :: Proxy (SqlExpr (Maybe (Entity a))) -> Int Source # sqlSelectProcessRow :: [PersistValue] -> Either Text (Maybe (Entity a)) Source # sqlInsertInto :: IdentInfo -> SqlExpr (Maybe (Entity a)) -> (Builder, [PersistValue]) Source # | |
| type ToMaybeT (SqlExpr (Value a)) Source # | |
| type ToMaybeT (SqlExpr (Entity a)) Source # | |
| type ToMaybeT (SqlExpr (Maybe a)) Source # | |
Defined in Database.Esqueleto.Experimental.ToMaybe | |
type SqlEntity ent = (PersistEntity ent, PersistEntityBackend ent ~ SqlBackend) Source #
Constraint synonym for persistent entities whose backend
is SqlBackend.
select :: forall a r (m :: Type -> Type) backend. (SqlSelect a r, MonadIO m, SqlBackendCanRead backend) => SqlQuery a -> ReaderT backend m [r] Source #
Execute an esqueleto SELECT query inside persistent's
SqlPersistT monad and return a list of rows.
We've seen that from has some magic about which kinds of
things you may bring into scope. This select function also
has some magic for which kinds of things you may bring back to
Haskell-land by using SqlQuery's return:
- You may return a
SqlExpr (for an entityEntityv)v(i.e., like the*in SQL), which is then returned to Haskell-land as justEntity v. - You may return a
SqlExpr (Maybe (Entity v))for an entityvthat may beNULL, which is then returned to Haskell-land asMaybe (Entity v). Used forOUTER JOINs. - You may return a
SqlExpr (for a valueValuet)t(i.e., a single column), wheretis any instance ofPersistField, which is then returned to Haskell-land asValue t. You may useValueto return projections of anEntity(see(and^.)() or to return any other value calculated on the query (e.g.,?.)countRowsorsubSelect).
The SqlSelect a r class has functional dependencies that
allow type information to flow both from a to r and
vice-versa. This means that you'll almost never have to give
any type signatures for esqueleto queries. For example, the
query alone is ambiguous, but
in the context ofselect $ from $ \p -> return p
do ps <-select$from$ \p -> return p liftIO $ mapM_ (putStrLn . personName . entityVal) ps
we are able to infer from that single personName . entityVal
function composition that the p inside the query is of type
SqlExpr (Entity Person).
selectOne :: forall a r (m :: Type -> Type) backend. (SqlSelect a r, MonadIO m, SqlBackendCanRead backend) => SqlQuery a -> ReaderT backend m (Maybe r) Source #
Execute an esqueleto SELECT query inside persistent's
SqlPersistT monad and return the first entry wrapped in a Maybe.
@since 3.5.1.0
Example usage
firstPerson :: MonadIO m => SqlPersistT m (Maybe (Entity Person)) firstPerson =selectOne$ do person <-from$table@Person return person
The above query is equivalent to a select combined with limit but you
would still have to transform the results from a list:
firstPerson :: MonadIO m => SqlPersistT m [Entity Person] firstPerson =select$ do person <-from$table@Personlimit1 return person
selectSource :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, IsPersistBackend backend, PersistQueryRead backend, PersistStoreRead backend, PersistUniqueRead backend, MonadResource m) => SqlQuery a -> ConduitT () r (ReaderT backend m) () Source #
Execute an esqueleto SELECT query inside persistent's
SqlPersistT monad and return a Source of rows.
delete :: forall (m :: Type -> Type) backend. (MonadIO m, SqlBackendCanWrite backend) => SqlQuery () -> ReaderT backend m () Source #
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<.valnow)
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(EntityAppointment)) -> return ()
Database.Esqueleto.Experimental:
delete $ do
userFeature <- from $ table @UserFeature
where_ ((userFeature ^. UserFeatureFeature) notIn valList allKnownFeatureFlags)
deleteCount :: forall (m :: Type -> Type) backend. (MonadIO m, SqlBackendCanWrite backend) => SqlQuery () -> ReaderT backend m Int64 Source #
Same as delete, but returns the number of rows affected.
update :: forall (m :: Type -> Type) val backend. (MonadIO m, PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val), SqlBackendCanWrite backend) => (SqlExpr (Entity val) -> SqlQuery ()) -> ReaderT backend m () Source #
Execute an esqueleto UPDATE query inside persistent's
SqlPersistT monad. Note that currently there are no type
checks for statements that should not appear on a UPDATE
query.
Example of usage:
update$ \p -> dosetp [ PersonAge=.just(valthisYear) -. p^.PersonBorn ]where_$ isNothing (p^.PersonAge)
updateCount :: forall (m :: Type -> Type) val backend. (MonadIO m, PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val), SqlBackendCanWrite backend) => (SqlExpr (Entity val) -> SqlQuery ()) -> ReaderT backend m Int64 Source #
Same as update, but returns the number of rows affected.
insertSelect :: forall (m :: Type -> Type) a backend. (MonadIO m, PersistEntity a, SqlBackendCanWrite backend) => SqlQuery (SqlExpr (Insertion a)) -> ReaderT backend m () Source #
Insert a PersistField for every selected value.
Since: 2.4.2
insertSelectCount :: forall (m :: Type -> Type) a backend. (MonadIO m, PersistEntity a, SqlBackendCanWrite backend) => SqlQuery (SqlExpr (Insertion a)) -> ReaderT backend m Int64 Source #
Insert a PersistField for every selected value, return the count afterward
(<#) :: (a -> b) -> SqlExpr (Value a) -> SqlExpr (Insertion b) Source #
Apply a PersistField constructor to SqlExpr Value arguments.
(<&>) :: SqlExpr (Insertion (a -> b)) -> SqlExpr (Value a) -> SqlExpr (Insertion b) Source #
Apply extra SqlExpr Value arguments to a PersistField constructor
Rendering Queries
Arguments
| :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) | |
| => Mode | |
| -> SqlQuery a | The SQL query you want to render. |
| -> ReaderT backend m (Text, [PersistValue]) |
Renders a SqlQuery into a Text value along with the list of
PersistValues that would be supplied to the database for ? placeholders.
You must ensure that the Mode you pass to this function corresponds with
the actual SqlQuery. If you pass a query that uses incompatible features
(like an INSERT statement with a SELECT mode) then you'll get a weird
result.
Since: 3.1.1
Arguments
| :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) | |
| => SqlQuery a | The SQL query you want to render. |
| -> ReaderT backend m (Text, [PersistValue]) |
Renders a SqlQuery into a Text value along with the list of
PersistValues that would be supplied to the database for ? placeholders.
Since: 3.1.1
Arguments
| :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) | |
| => SqlQuery a | The SQL query you want to render. |
| -> ReaderT backend m (Text, [PersistValue]) |
Renders a SqlQuery into a Text value along with the list of
PersistValues that would be supplied to the database for ? placeholders.
Since: 3.1.1
Arguments
| :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) | |
| => SqlQuery a | The SQL query you want to render. |
| -> ReaderT backend m (Text, [PersistValue]) |
Renders a SqlQuery into a Text value along with the list of
PersistValues that would be supplied to the database for ? placeholders.
Since: 3.1.1
renderQueryInsertInto Source #
Arguments
| :: forall a r backend (m :: Type -> Type). (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) | |
| => SqlQuery a | The SQL query you want to render. |
| -> ReaderT backend m (Text, [PersistValue]) |
Renders a SqlQuery into a Text value along with the list of
PersistValues that would be supplied to the database for ? placeholders.
Since: 3.1.1
Internal.Language
Minimal complete definition
Instances
RDBMS-specific modules
There are many differences between SQL syntax and functions
supported by different RDBMSs. Since version 2.2.8,
esqueleto includes modules containing functions that are
specific to a given RDBMS.
- PostgreSQL: Database.Esqueleto.PostgreSQL.
In order to use these functions, you need to explicitly import their corresponding modules, they're not re-exported here.
Helpers
valkey :: (ToBackendKey SqlBackend entity, PersistField (Key entity)) => Int64 -> SqlExpr (Value (Key entity)) Source #
valkey i =
(https://github.com/prowdsponsor/esqueleto/issues/9).val . toSqlKey
valJ :: PersistField (Key entity) => Value (Key entity) -> SqlExpr (Value (Key entity)) Source #
valJ is like val but for something that is already a Value. The use
case it was written for was, given a Value lift the Key for that Value
into the query expression in a type safe way. However, the implementation is
more generic than that so we call it valJ.
Its important to note that the input entity and the output entity are constrained to be the same by the type signature on the function (https://github.com/prowdsponsor/esqueleto/pull/69).
Since: 1.4.2
associateJoin :: forall e1 e0. Ord (Key e0) => [(Entity e0, e1)] -> Map (Key e0) (e0, [e1]) Source #
Avoid N+1 queries and join entities into a map structure.
This function is useful to call on the result of a single JOIN. For
example, suppose you have this query:
getFoosAndNestedBarsFromParent
:: ParentId
-> SqlPersistT IO [(Entity Foo, Maybe (Entity Bar))]
getFoosAndNestedBarsFromParent parentId =
select $ do
(foo :& bar) <- from $
table Foo
`LeftOuterJoin`
table Bar
`on` do
\(foo :& bar) ->
foo ^. FooId ==. bar ?. BarFooId
where_ $
foo ^. FooParentId ==. val parentId
pure (foo, bar)
This is a natural result type for SQL - a list of tuples. However, it's not
what we usually want in Haskell - each Foo in the list will be represented
multiple times, once for each Bar.
We can write and it will translate it into a fmap associateJoinMap
that is keyed on the Key of the left Entity, and the value is a tuple of
the entity's value as well as the list of each coresponding entity.
getFoosAndNestedBarsFromParentHaskellese
:: ParentId
-> SqlPersistT (Map (Key Foo) (Foo, [Maybe (Entity Bar)]))
getFoosAndNestedBarsFromParentHaskellese parentId =
fmap associateJoin $ getFoosdAndNestedBarsFromParent parentId
What if you have multiple joins?
Let's use associateJoin with a *two* join query.
userPostComments
:: SqlQuery (SqlExpr (Entity User, Entity Post, Entity Comment))
userPostsComment = do
(u :& p :& c) <- from $
table User
`InnerJoin`
table Post
on do
\(u :& p) ->
u ^. UserId ==. p ^. PostUserId
`InnerJoin`
table @Comment
`on` do
\(_ :& p :& c) ->
p ^. PostId ==. c ^. CommentPostId
pure (u, p, c)
This query returns a User, with all of the users Posts, and then all of the Comments on that post.
First, we *nest* the tuple.
nest :: (a, b, c) -> (a, (b, c)) nest (a, b, c) = (a, (b, c))
This makes the return of the query conform to the input expected from
associateJoin.
nestedUserPostComments
:: SqlPersistT IO [(Entity User, (Entity Post, Entity Comment))]
nestedUserPostComments =
fmap nest $ select userPostsComments
Now, we can call associateJoin on it.
associateUsers
:: [(Entity User, (Entity Post, Entity Comment))]
-> Map UserId (User, [(Entity Post, Entity Comment)])
associateUsers =
associateJoin
Next, we'll use the Functor instances for Map and tuple to call
associateJoin on the [(Entity Post, Entity Comment)].
associatePostsAndComments
:: Map UserId (User, [(Entity Post, Entity Comment)])
-> Map UserId (User, Map PostId (Post, [Entity Comment]))
associatePostsAndComments =
fmap (fmap associateJoin)
For more reading on this topic, see this Foxhound Systems blog post.
Since: 3.1.2
Re-exports
We re-export many symbols from persistent for convenince:
- "Store functions" from Database.Persist.
- Everything from Database.Persist.Class except for
PersistQueryanddelete(usedeleteKeyinstead). - Everything from Database.Persist.Types except for
Update,SelectOpt,BackendSpecificFilterandFilter. - Everything from Database.Persist.Sql except for
deleteWhereCountandupdateWhereCount.
deleteKey :: forall backend val (m :: Type -> Type). (PersistStore backend, BaseBackend backend ~ PersistEntityBackend val, MonadIO m, PersistEntity val) => Key val -> ReaderT backend m () Source #
Constructors
| SqlString | |
| SqlInt32 | |
| SqlInt64 | |
| SqlReal | |
| SqlNumeric Word32 Word32 | |
| SqlBool | |
| SqlDay | |
| SqlTime | |
| SqlDayTime | |
| SqlBlob | |
| SqlOther Text |
data IsNullable #
Constructors
| Nullable !WhyNullable | |
| NotNullable |
Instances
| Show IsNullable | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> IsNullable -> ShowS show :: IsNullable -> String showList :: [IsNullable] -> ShowS | |
| Eq IsNullable | |
Defined in Database.Persist.Types.Base | |
newtype EntityNameDB #
Constructors
| EntityNameDB | |
Fields
| |
Instances
newtype FieldNameDB #
Constructors
| FieldNameDB | |
Fields
| |
Instances
class SymbolToField (sym :: Symbol) rec typ | sym rec -> typ where #
Methods
symbolToField :: EntityField rec typ #
data SqlBackend #
Instances
class (PersistUniqueRead backend, PersistStoreWrite backend) => PersistUniqueWrite backend where #
Minimal complete definition
Methods
deleteBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Unique record -> ReaderT backend m () #
insertUnique :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => record -> ReaderT backend m (Maybe (Key record)) #
insertUnique_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => record -> ReaderT backend m (Maybe ()) #
upsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, OnlyOneUniqueKey record, SafeToInsert record) => record -> [Update record] -> ReaderT backend m (Entity record) #
upsertBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => Unique record -> record -> [Update record] -> ReaderT backend m (Entity record) #
putMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m () #
Instances
| PersistUniqueWrite SqlWriteBackend | |
Defined in Database.Persist.Sql.Orphan.PersistUnique Methods deleteBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Unique record -> ReaderT SqlWriteBackend m () # insertUnique :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => record -> ReaderT SqlWriteBackend m (Maybe (Key record)) # insertUnique_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => record -> ReaderT SqlWriteBackend m (Maybe ()) # upsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, OnlyOneUniqueKey record, SafeToInsert record) => record -> [Update record] -> ReaderT SqlWriteBackend m (Entity record) # upsertBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => Unique record -> record -> [Update record] -> ReaderT SqlWriteBackend m (Entity record) # putMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => [record] -> ReaderT SqlWriteBackend m () # | |
| PersistUniqueWrite SqlBackend | |
Defined in Database.Persist.Sql.Orphan.PersistUnique Methods deleteBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => Unique record -> ReaderT SqlBackend m () # insertUnique :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> ReaderT SqlBackend m (Maybe (Key record)) # insertUnique_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> ReaderT SqlBackend m (Maybe ()) # upsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend, OnlyOneUniqueKey record, SafeToInsert record) => record -> [Update record] -> ReaderT SqlBackend m (Entity record) # upsertBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend, SafeToInsert record) => Unique record -> record -> [Update record] -> ReaderT SqlBackend m (Entity record) # putMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> ReaderT SqlBackend m () # | |
Constructors
| UniqueDef | |
Fields
| |
Instances
| Read UniqueDef | |
Defined in Database.Persist.Types.Base | |
| Show UniqueDef | |
| Eq UniqueDef | |
| Ord UniqueDef | |
Defined in Database.Persist.Types.Base | |
| Lift UniqueDef | |
newtype ConstraintNameDB #
Constructors
| ConstraintNameDB | |
Fields
| |
Instances
| Read ConstraintNameDB | |
Defined in Database.Persist.Names Methods readsPrec :: Int -> ReadS ConstraintNameDB readList :: ReadS [ConstraintNameDB] readPrec :: ReadPrec ConstraintNameDB readListPrec :: ReadPrec [ConstraintNameDB] | |
| Show ConstraintNameDB | |
Defined in Database.Persist.Names Methods showsPrec :: Int -> ConstraintNameDB -> ShowS show :: ConstraintNameDB -> String showList :: [ConstraintNameDB] -> ShowS | |
| Eq ConstraintNameDB | |
Defined in Database.Persist.Names Methods (==) :: ConstraintNameDB -> ConstraintNameDB -> Bool (/=) :: ConstraintNameDB -> ConstraintNameDB -> Bool | |
| Ord ConstraintNameDB | |
Defined in Database.Persist.Names Methods compare :: ConstraintNameDB -> ConstraintNameDB -> Ordering (<) :: ConstraintNameDB -> ConstraintNameDB -> Bool (<=) :: ConstraintNameDB -> ConstraintNameDB -> Bool (>) :: ConstraintNameDB -> ConstraintNameDB -> Bool (>=) :: ConstraintNameDB -> ConstraintNameDB -> Bool max :: ConstraintNameDB -> ConstraintNameDB -> ConstraintNameDB min :: ConstraintNameDB -> ConstraintNameDB -> ConstraintNameDB | |
| DatabaseName ConstraintNameDB | |
Defined in Database.Persist.Names Methods escapeWith :: (Text -> str) -> ConstraintNameDB -> str # | |
| Lift ConstraintNameDB | |
Defined in Database.Persist.Names Methods lift :: Quote m => ConstraintNameDB -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => ConstraintNameDB -> Code m ConstraintNameDB | |
class PersistEntity record => OnlyOneUniqueKey record where #
Methods
onlyUniqueP :: record -> Unique record #
Instances
| (PersistEntity rec, PersistField typ, SymbolToField sym rec typ) => HasField (sym :: Symbol) (SqlExpr (Entity rec)) (SqlExpr (Value typ)) | This instance allows you to use Example: -- persistent model:
BlogPost
authorId PersonId
title Text
-- query:
This is exactly equivalent to the following: blogPost :: SqlExpr (Entity BlogPost) blogPost ^. BlogPostTitle blogPost ^. #title blogPost.title There's another instance defined on Since: 3.5.4.0 | ||||
| (PersistEntity rec, PersistField typ, PersistField typ', SymbolToField sym rec typ, NullableFieldProjection typ typ', HasField sym (SqlExpr (Maybe (Entity rec))) (SqlExpr (Value (Maybe typ')))) => HasField (sym :: Symbol) (SqlExpr (Maybe (Entity rec))) (SqlExpr (Value (Maybe typ'))) | This instance allows you to use Example: -- persistent model:
Person
name Text
BlogPost
title Text
authorId PersonId
-- query:
The following forms are all equivalent: blogPost :: SqlExpr (Maybe (Entity BlogPost)) blogPost ?. BlogPostTitle blogPost ?. #title blogPost.title Since: 3.5.4.0 | ||||
| ToAlias (SqlExpr (Entity a)) Source # | |||||
| ToAlias (SqlExpr (Maybe (Entity a))) Source # | |||||
| ToAliasReference (SqlExpr (Entity a)) Source # | |||||
| ToAliasReference (SqlExpr (Maybe (Entity a))) Source # | |||||
| ToMaybe (SqlExpr (Entity a)) Source # | |||||
| FromPreprocess (SqlExpr (Entity val)) => From (SqlExpr (Entity val)) Source # | |||||
| FromPreprocess (SqlExpr (Maybe (Entity val))) => From (SqlExpr (Maybe (Entity val))) Source # | |||||
| (PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val)) => FromPreprocess (SqlExpr (Entity val)) Source # | |||||
Defined in Database.Esqueleto.Internal.Internal Methods fromPreprocess :: SqlQuery (PreprocessedFrom (SqlExpr (Entity val))) Source # | |||||
| (PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val)) => FromPreprocess (SqlExpr (Maybe (Entity val))) Source # | |||||
Defined in Database.Esqueleto.Internal.Internal Methods fromPreprocess :: SqlQuery (PreprocessedFrom (SqlExpr (Maybe (Entity val)))) Source # | |||||
| PersistEntity val => LockableEntity (SqlExpr (Entity val)) Source # | |||||
Defined in Database.Esqueleto.Internal.Internal Methods flattenLockableEntity :: SqlExpr (Entity val) -> NonEmpty LockableSqlExpr Source # | |||||
| (Generic (Key record), Generic record) => Generic (Entity record) | |||||
Defined in Database.Persist.Class.PersistEntity Associated Types
| |||||
| (Read (Key record), Read record) => Read (Entity record) | |||||
Defined in Database.Persist.Class.PersistEntity | |||||
| (Show (Key record), Show record) => Show (Entity record) | |||||
| (Eq (Key record), Eq record) => Eq (Entity record) | |||||
| (Ord (Key record), Ord record) => Ord (Entity record) | |||||
Defined in Database.Persist.Class.PersistEntity | |||||
| (TypeError (EntityErrorMessage a) :: Constraint) => SafeToInsert (Entity a) | |||||
Defined in Database.Persist.Class.PersistEntity | |||||
| (PersistEntity record, PersistField record, PersistField (Key record)) => PersistField (Entity record) | |||||
Defined in Database.Persist.Class.PersistEntity Methods toPersistValue :: Entity record -> PersistValue # fromPersistValue :: PersistValue -> Either Text (Entity record) # | |||||
| (PersistField record, PersistEntity record) => PersistFieldSql (Entity record) | |||||
Defined in Database.Persist.Sql.Class | |||||
| (PersistEntity record, PersistEntityBackend record ~ backend, IsPersistBackend backend) => RawSql (Entity record) | |||||
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> Entity record -> (Int, [Text]) # rawSqlColCountReason :: Entity record -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (Entity record) # | |||||
| PersistEntity ent => ToFrom (Table ent) (SqlExpr (Entity ent)) Source # | |||||
| PersistEntity a => SqlSelect (SqlExpr (Entity a)) (Entity a) Source # | |||||
Defined in Database.Esqueleto.Internal.Internal Methods sqlSelectCols :: IdentInfo -> SqlExpr (Entity a) -> (Builder, [PersistValue]) Source # sqlSelectColCount :: Proxy (SqlExpr (Entity a)) -> Int Source # sqlSelectProcessRow :: [PersistValue] -> Either Text (Entity a) Source # sqlInsertInto :: IdentInfo -> SqlExpr (Entity a) -> (Builder, [PersistValue]) Source # | |||||
| PersistEntity a => SqlSelect (SqlExpr (Maybe (Entity a))) (Maybe (Entity a)) Source # | |||||
Defined in Database.Esqueleto.Internal.Internal Methods sqlSelectCols :: IdentInfo -> SqlExpr (Maybe (Entity a)) -> (Builder, [PersistValue]) Source # sqlSelectColCount :: Proxy (SqlExpr (Maybe (Entity a))) -> Int Source # sqlSelectProcessRow :: [PersistValue] -> Either Text (Maybe (Entity a)) Source # sqlInsertInto :: IdentInfo -> SqlExpr (Maybe (Entity a)) -> (Builder, [PersistValue]) Source # | |||||
| type ToMaybeT (SqlExpr (Entity a)) Source # | |||||
| type Rep (Entity record) | |||||
Defined in Database.Persist.Class.PersistEntity type Rep (Entity record) = D1 ('MetaData "Entity" "Database.Persist.Class.PersistEntity" "persistent-2.17.1.0-CNr6HPZgY5e9DN7Ni1cM6v" 'False) (C1 ('MetaCons "Entity" 'PrefixI 'True) (S1 ('MetaSel ('Just "entityKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Key record)) :*: S1 ('MetaSel ('Just "entityVal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 record))) | |||||
data PersistValue #
Constructors
| PersistText Text | |
| PersistByteString ByteString | |
| PersistInt64 Int64 | |
| PersistDouble Double | |
| PersistRational Rational | |
| PersistBool Bool | |
| PersistDay Day | |
| PersistTimeOfDay TimeOfDay | |
| PersistUTCTime UTCTime | |
| PersistNull | |
| PersistList [PersistValue] | |
| PersistMap [(Text, PersistValue)] | |
| PersistObjectId ByteString | |
| PersistArray [PersistValue] | |
| PersistLiteral_ LiteralType ByteString |
Bundled Patterns
| pattern PersistDbSpecific :: ByteString -> PersistValue | |
| pattern PersistLiteral :: ByteString -> PersistValue | |
| pattern PersistLiteralEscaped :: ByteString -> PersistValue |
Instances
| FromJSON PersistValue | |
Defined in Database.Persist.PersistValue Methods parseJSON :: Value -> Parser PersistValue parseJSONList :: Value -> Parser [PersistValue] omittedField :: Maybe PersistValue | |
| ToJSON PersistValue | |
Defined in Database.Persist.PersistValue Methods toJSON :: PersistValue -> Value toEncoding :: PersistValue -> Encoding toJSONList :: [PersistValue] -> Value toEncodingList :: [PersistValue] -> Encoding omitField :: PersistValue -> Bool | |
| NFData PersistValue | |
Defined in Database.Persist.PersistValue Methods rnf :: PersistValue -> () | |
| Read PersistValue | |
Defined in Database.Persist.PersistValue Methods readsPrec :: Int -> ReadS PersistValue readList :: ReadS [PersistValue] readPrec :: ReadPrec PersistValue readListPrec :: ReadPrec [PersistValue] | |
| Show PersistValue | |
Defined in Database.Persist.PersistValue Methods showsPrec :: Int -> PersistValue -> ShowS show :: PersistValue -> String showList :: [PersistValue] -> ShowS | |
| Eq PersistValue | |
Defined in Database.Persist.PersistValue | |
| Ord PersistValue | |
Defined in Database.Persist.PersistValue Methods compare :: PersistValue -> PersistValue -> Ordering (<) :: PersistValue -> PersistValue -> Bool (<=) :: PersistValue -> PersistValue -> Bool (>) :: PersistValue -> PersistValue -> Bool (>=) :: PersistValue -> PersistValue -> Bool max :: PersistValue -> PersistValue -> PersistValue min :: PersistValue -> PersistValue -> PersistValue | |
| FromHttpApiData PersistValue | |
Defined in Database.Persist.PersistValue Methods parseUrlPiece :: Text -> Either Text PersistValue parseHeader :: ByteString -> Either Text PersistValue parseQueryParam :: Text -> Either Text PersistValue | |
| ToHttpApiData PersistValue | |
Defined in Database.Persist.PersistValue Methods toUrlPiece :: PersistValue -> Text toEncodedUrlPiece :: PersistValue -> Builder toHeader :: PersistValue -> ByteString toQueryParam :: PersistValue -> Text toEncodedQueryParam :: PersistValue -> Builder | |
| PathPiece PersistValue | |
Defined in Database.Persist.PersistValue | |
| PersistField PersistValue | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: PersistValue -> PersistValue # fromPersistValue :: PersistValue -> Either Text PersistValue # | |
| PersistFieldSql PersistValue | |
Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy PersistValue -> SqlType # | |
data PersistFilter #
Instances
| Read PersistFilter | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS PersistFilter readList :: ReadS [PersistFilter] readPrec :: ReadPrec PersistFilter readListPrec :: ReadPrec [PersistFilter] | |
| Show PersistFilter | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> PersistFilter -> ShowS show :: PersistFilter -> String showList :: [PersistFilter] -> ShowS | |
| Lift PersistFilter | |
Defined in Database.Persist.Types.Base Methods lift :: Quote m => PersistFilter -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => PersistFilter -> Code m PersistFilter | |
class (Show (BackendKey backend), Read (BackendKey backend), Eq (BackendKey backend), Ord (BackendKey backend), PersistStoreRead backend, PersistField (BackendKey backend), ToJSON (BackendKey backend), FromJSON (BackendKey backend)) => PersistStoreWrite backend where #
Methods
insert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => record -> ReaderT backend m (Key record) #
insert_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => record -> ReaderT backend m () #
insertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m [Key record] #
insertMany_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m () #
insertEntityMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => [Entity record] -> ReaderT backend m () #
insertKey :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Key record -> record -> ReaderT backend m () #
repsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Key record -> record -> ReaderT backend m () #
repsertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => [(Key record, record)] -> ReaderT backend m () #
replace :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Key record -> record -> ReaderT backend m () #
updateGet :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Key record -> [Update record] -> ReaderT backend m record #
Instances
| PersistStoreWrite SqlWriteBackend | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods insert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => record -> ReaderT SqlWriteBackend m (Key record) # insert_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => record -> ReaderT SqlWriteBackend m () # insertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => [record] -> ReaderT SqlWriteBackend m [Key record] # insertMany_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => [record] -> ReaderT SqlWriteBackend m () # insertEntityMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Entity record] -> ReaderT SqlWriteBackend m () # insertKey :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> record -> ReaderT SqlWriteBackend m () # repsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> record -> ReaderT SqlWriteBackend m () # repsertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [(Key record, record)] -> ReaderT SqlWriteBackend m () # replace :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> record -> ReaderT SqlWriteBackend m () # delete :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> ReaderT SqlWriteBackend m () update :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> [Update record] -> ReaderT SqlWriteBackend m () updateGet :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> [Update record] -> ReaderT SqlWriteBackend m record # | |
| PersistStoreWrite SqlBackend | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods insert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> ReaderT SqlBackend m (Key record) # insert_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend, SafeToInsert record) => record -> ReaderT SqlBackend m () # insertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> ReaderT SqlBackend m [Key record] # insertMany_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend, SafeToInsert record) => [record] -> ReaderT SqlBackend m () # insertEntityMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => [Entity record] -> ReaderT SqlBackend m () # insertKey :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => Key record -> record -> ReaderT SqlBackend m () # repsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => Key record -> record -> ReaderT SqlBackend m () # repsertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => [(Key record, record)] -> ReaderT SqlBackend m () # replace :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => Key record -> record -> ReaderT SqlBackend m () # delete :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => Key record -> ReaderT SqlBackend m () update :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => Key record -> [Update record] -> ReaderT SqlBackend m () updateGet :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => Key record -> [Update record] -> ReaderT SqlBackend m record # | |
toJsonText :: ToJSON j => j -> Text #
type PersistStore a = PersistStoreWrite a #
type PersistUnique a = PersistUniqueWrite a #
class PersistConfig c where #
Minimal complete definition
Associated Types
type PersistConfigBackend c :: (Type -> Type) -> Type -> Type #
type PersistConfigPool c #
Methods
loadConfig :: Value -> Parser c #
createPoolConfig :: c -> IO (PersistConfigPool c) #
runPool :: MonadUnliftIO m => c -> PersistConfigBackend c m a -> PersistConfigPool c -> m a #
Instances
| (PersistConfig c1, PersistConfig c2, PersistConfigPool c1 ~ PersistConfigPool c2, PersistConfigBackend c1 ~ PersistConfigBackend c2) => PersistConfig (Either c1 c2) | |||||||||
Defined in Database.Persist.Class.PersistConfig Associated Types
Methods loadConfig :: Value -> Parser (Either c1 c2) # applyEnv :: Either c1 c2 -> IO (Either c1 c2) # createPoolConfig :: Either c1 c2 -> IO (PersistConfigPool (Either c1 c2)) # runPool :: MonadUnliftIO m => Either c1 c2 -> PersistConfigBackend (Either c1 c2) m a -> PersistConfigPool (Either c1 c2) -> m a # | |||||||||
type family PersistConfigBackend c :: (Type -> Type) -> Type -> Type #
Instances
| type PersistConfigBackend (Either c1 c2) | |
Defined in Database.Persist.Class.PersistConfig | |
type family PersistConfigPool c #
Instances
| type PersistConfigPool (Either c1 c2) | |
Defined in Database.Persist.Class.PersistConfig | |
type family BackendSpecificUpdate backend record #
data PersistUpdate #
Instances
| Read PersistUpdate | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS PersistUpdate readList :: ReadS [PersistUpdate] readPrec :: ReadPrec PersistUpdate readListPrec :: ReadPrec [PersistUpdate] | |
| Show PersistUpdate | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> PersistUpdate -> ShowS show :: PersistUpdate -> String showList :: [PersistUpdate] -> ShowS | |
| Lift PersistUpdate | |
Defined in Database.Persist.Types.Base Methods lift :: Quote m => PersistUpdate -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => PersistUpdate -> Code m PersistUpdate | |
class (PersistField (Key record), ToJSON (Key record), FromJSON (Key record), Show (Key record), Read (Key record), Eq (Key record), Ord (Key record)) => PersistEntity record where #
Minimal complete definition
keyToValues, keyFromValues, persistIdField, entityDef, persistFieldDef, toPersistFields, fromPersistValues, tabulateEntityA, tabulateEntityApply, persistUniqueKeys, persistUniqueToFieldNames, persistUniqueToValues, fieldLens
Methods
keyToValues :: Key record -> [PersistValue] #
keyFromValues :: [PersistValue] -> Either Text (Key record) #
persistIdField :: EntityField record (Key record) #
entityDef :: proxy record -> EntityDef #
persistFieldDef :: EntityField record typ -> FieldDef #
toPersistFields :: record -> [PersistValue] #
fromPersistValues :: [PersistValue] -> Either Text record #
tabulateEntityA :: Applicative f => (forall a. EntityField record a -> f a) -> f (Entity record) #
tabulateEntityApply :: Apply f => (forall a. EntityField record a -> f a) -> f (Entity record) #
persistUniqueKeys :: record -> [Unique record] #
persistUniqueToFieldNames :: Unique record -> NonEmpty (FieldNameHS, FieldNameDB) #
persistUniqueToValues :: Unique record -> [PersistValue] #
fieldLens :: EntityField record field -> forall (f :: Type -> Type). Functor f => (field -> f field) -> Entity record -> f (Entity record) #
keyFromRecordM :: Maybe (record -> Key record) #
data family EntityField record :: Type -> Type #
Instances
| SymbolToField sym rec typ => IsLabel sym (EntityField rec typ) | |
Defined in Database.Persist.Class.PersistEntity Methods fromLabel :: EntityField rec typ | |
data FilterValue typ where #
Constructors
| FilterValue :: forall typ. typ -> FilterValue typ | |
| FilterValues :: forall typ. [typ] -> FilterValue typ | |
| UnsafeValue :: forall a typ. PersistField a => a -> FilterValue typ |
Instances
| (PersistEntity a, PersistEntityBackend a ~ backend, IsPersistBackend backend) => RawSql (Key a) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> Key a -> (Int, [Text]) # rawSqlColCountReason :: Key a -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (Key a) # | |
type family PersistEntityBackend record #
class SafeToInsert a #
Instances
| (TypeError (EntityErrorMessage a) :: Constraint) => SafeToInsert (Entity a) | |
Defined in Database.Persist.Class.PersistEntity | |
| (TypeError (FunctionErrorMessage a b) :: Constraint) => SafeToInsert (a -> b) | |
Defined in Database.Persist.Class.PersistEntity | |
Instances
| FinalResult (Unique val) Source # | |
Defined in Database.Esqueleto.Internal.Internal | |
entityIdFromJSON :: (PersistEntity record, FromJSON record) => Value -> Parser (Entity record) #
entityIdToJSON :: (PersistEntity record, ToJSON record) => Entity record -> Value #
entityValues :: PersistEntity record => Entity record -> [PersistValue] #
fromPersistValueJSON :: FromJSON a => PersistValue -> Either Text a #
keyValueEntityFromJSON :: (PersistEntity record, FromJSON record) => Value -> Parser (Entity record) #
keyValueEntityToJSON :: (PersistEntity record, ToJSON record) => Entity record -> Value #
tabulateEntity :: PersistEntity record => (forall a. EntityField record a -> a) -> Entity record #
toPersistValueJSON :: ToJSON a => a -> PersistValue #
newtype OverflowNatural #
Constructors
| OverflowNatural | |
Fields
| |
Instances
| Num OverflowNatural | |
Defined in Database.Persist.Class.PersistField Methods (+) :: OverflowNatural -> OverflowNatural -> OverflowNatural (-) :: OverflowNatural -> OverflowNatural -> OverflowNatural (*) :: OverflowNatural -> OverflowNatural -> OverflowNatural negate :: OverflowNatural -> OverflowNatural abs :: OverflowNatural -> OverflowNatural signum :: OverflowNatural -> OverflowNatural fromInteger :: Integer -> OverflowNatural | |
| Show OverflowNatural | |
Defined in Database.Persist.Class.PersistField Methods showsPrec :: Int -> OverflowNatural -> ShowS show :: OverflowNatural -> String showList :: [OverflowNatural] -> ShowS | |
| Eq OverflowNatural | |
Defined in Database.Persist.Class.PersistField Methods (==) :: OverflowNatural -> OverflowNatural -> Bool (/=) :: OverflowNatural -> OverflowNatural -> Bool | |
| Ord OverflowNatural | |
Defined in Database.Persist.Class.PersistField Methods compare :: OverflowNatural -> OverflowNatural -> Ordering (<) :: OverflowNatural -> OverflowNatural -> Bool (<=) :: OverflowNatural -> OverflowNatural -> Bool (>) :: OverflowNatural -> OverflowNatural -> Bool (>=) :: OverflowNatural -> OverflowNatural -> Bool max :: OverflowNatural -> OverflowNatural -> OverflowNatural min :: OverflowNatural -> OverflowNatural -> OverflowNatural | |
| PersistField OverflowNatural | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: OverflowNatural -> PersistValue # fromPersistValue :: PersistValue -> Either Text OverflowNatural # | |
| PersistFieldSql OverflowNatural | |
Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy OverflowNatural -> SqlType # | |
class PersistField a where #
Instances
| PersistField Html | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Html -> PersistValue # fromPersistValue :: PersistValue -> Either Text Html # | |
| PersistField ByteString | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: ByteString -> PersistValue # fromPersistValue :: PersistValue -> Either Text ByteString # | |
| PersistField Int16 | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Int16 -> PersistValue # fromPersistValue :: PersistValue -> Either Text Int16 # | |
| PersistField Int32 | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Int32 -> PersistValue # fromPersistValue :: PersistValue -> Either Text Int32 # | |
| PersistField Int64 | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Int64 -> PersistValue # fromPersistValue :: PersistValue -> Either Text Int64 # | |
| PersistField Int8 | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Int8 -> PersistValue # fromPersistValue :: PersistValue -> Either Text Int8 # | |
| PersistField Rational | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Rational -> PersistValue # fromPersistValue :: PersistValue -> Either Text Rational # | |
| PersistField Word16 | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Word16 -> PersistValue # fromPersistValue :: PersistValue -> Either Text Word16 # | |
| PersistField Word32 | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Word32 -> PersistValue # fromPersistValue :: PersistValue -> Either Text Word32 # | |
| PersistField Word64 | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Word64 -> PersistValue # fromPersistValue :: PersistValue -> Either Text Word64 # | |
| PersistField Word8 | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Word8 -> PersistValue # fromPersistValue :: PersistValue -> Either Text Word8 # | |
| PersistField OverflowNatural | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: OverflowNatural -> PersistValue # fromPersistValue :: PersistValue -> Either Text OverflowNatural # | |
| PersistField PersistValue | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: PersistValue -> PersistValue # fromPersistValue :: PersistValue -> Either Text PersistValue # | |
| PersistField Checkmark | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Checkmark -> PersistValue # fromPersistValue :: PersistValue -> Either Text Checkmark # | |
| PersistField Text | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Text -> PersistValue # fromPersistValue :: PersistValue -> Either Text Text # | |
| PersistField Text | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Text -> PersistValue # fromPersistValue :: PersistValue -> Either Text Text # | |
| PersistField Day | |
Defined in Database.Persist.Class.PersistField | |
| PersistField UTCTime | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: UTCTime -> PersistValue # fromPersistValue :: PersistValue -> Either Text UTCTime # | |
| PersistField TimeOfDay | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: TimeOfDay -> PersistValue # fromPersistValue :: PersistValue -> Either Text TimeOfDay # | |
| (TypeError ((((('Text "The instance of PersistField for the Natural type was removed." ':$$: 'Text "Please see the documentation for OverflowNatural if you want to ") ':$$: 'Text "continue using the old behavior or want to see documentation on ") ':$$: 'Text "why the instance was removed.") ':$$: 'Text "") ':$$: 'Text "This error instance will be removed in a future release.") :: Constraint) => PersistField Natural | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Natural -> PersistValue # fromPersistValue :: PersistValue -> Either Text Natural # | |
| PersistField Bool | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Bool -> PersistValue # fromPersistValue :: PersistValue -> Either Text Bool # | |
| PersistField Double | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Double -> PersistValue # fromPersistValue :: PersistValue -> Either Text Double # | |
| PersistField Int | |
Defined in Database.Persist.Class.PersistField | |
| PersistField Word | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Word -> PersistValue # fromPersistValue :: PersistValue -> Either Text Word # | |
| PersistField v => PersistField (IntMap v) | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: IntMap v -> PersistValue # fromPersistValue :: PersistValue -> Either Text (IntMap v) # | |
| (Ord a, PersistField a) => PersistField (Set a) | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Set a -> PersistValue # fromPersistValue :: PersistValue -> Either Text (Set a) # | |
| (FromJSON a, ToJSON a) => PersistField (JSONB a) Source # | Since: 3.1.0 |
Defined in Database.Esqueleto.PostgreSQL.JSON.Instances Methods toPersistValue :: JSONB a -> PersistValue # fromPersistValue :: PersistValue -> Either Text (JSONB a) # | |
| (PersistEntity record, PersistField record, PersistField (Key record)) => PersistField (Entity record) | |
Defined in Database.Persist.Class.PersistEntity Methods toPersistValue :: Entity record -> PersistValue # fromPersistValue :: PersistValue -> Either Text (Entity record) # | |
| PersistField (BackendKey SqlReadBackend) | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlReadBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlReadBackend) # | |
| PersistField (BackendKey SqlWriteBackend) | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlWriteBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlWriteBackend) # | |
| PersistField (BackendKey SqlBackend) | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlBackend) # | |
| PersistField a => PersistField (Vector a) | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Vector a -> PersistValue # fromPersistValue :: PersistValue -> Either Text (Vector a) # | |
| PersistField a => PersistField (Maybe a) | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Maybe a -> PersistValue # fromPersistValue :: PersistValue -> Either Text (Maybe a) # | |
| PersistField [Char] | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: [Char] -> PersistValue # fromPersistValue :: PersistValue -> Either Text [Char] # | |
| PersistField a => PersistField [a] | |
Defined in Database.Persist.Class.PersistField | |
| HasResolution a => PersistField (Fixed a) | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Fixed a -> PersistValue # fromPersistValue :: PersistValue -> Either Text (Fixed a) # | |
| PersistField v => PersistField (Map Text v) | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Map Text v -> PersistValue # fromPersistValue :: PersistValue -> Either Text (Map Text v) # | |
| (PersistField a, PersistField b) => PersistField (a, b) | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: (a, b) -> PersistValue # fromPersistValue :: PersistValue -> Either Text (a, b) # | |
class (PersistCore backend, PersistStoreRead backend) => PersistQueryRead backend where #
Minimal complete definition
selectSourceRes, selectKeysRes, count, exists
Methods
selectSourceRes :: forall record (m1 :: Type -> Type) (m2 :: Type -> Type). (PersistRecordBackend record backend, MonadIO m1, MonadIO m2) => [Filter record] -> [SelectOpt record] -> ReaderT backend m1 (Acquire (ConduitM () (Entity record) m2 ())) #
selectFirst :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m (Maybe (Entity record)) #
selectKeysRes :: forall (m1 :: Type -> Type) (m2 :: Type -> Type) record. (MonadIO m1, MonadIO m2, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m1 (Acquire (ConduitM () (Key record) m2 ())) #
Instances
| PersistQueryRead SqlReadBackend | |
Defined in Database.Persist.Sql.Orphan.PersistQuery Methods selectSourceRes :: forall record (m1 :: Type -> Type) (m2 :: Type -> Type). (PersistRecordBackend record SqlReadBackend, MonadIO m1, MonadIO m2) => [Filter record] -> [SelectOpt record] -> ReaderT SqlReadBackend m1 (Acquire (ConduitM () (Entity record) m2 ())) # selectFirst :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlReadBackend) => [Filter record] -> [SelectOpt record] -> ReaderT SqlReadBackend m (Maybe (Entity record)) # selectKeysRes :: forall (m1 :: Type -> Type) (m2 :: Type -> Type) record. (MonadIO m1, MonadIO m2, PersistRecordBackend record SqlReadBackend) => [Filter record] -> [SelectOpt record] -> ReaderT SqlReadBackend m1 (Acquire (ConduitM () (Key record) m2 ())) # count :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlReadBackend) => [Filter record] -> ReaderT SqlReadBackend m Int exists :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlReadBackend) => [Filter record] -> ReaderT SqlReadBackend m Bool | |
| PersistQueryRead SqlWriteBackend | |
Defined in Database.Persist.Sql.Orphan.PersistQuery Methods selectSourceRes :: forall record (m1 :: Type -> Type) (m2 :: Type -> Type). (PersistRecordBackend record SqlWriteBackend, MonadIO m1, MonadIO m2) => [Filter record] -> [SelectOpt record] -> ReaderT SqlWriteBackend m1 (Acquire (ConduitM () (Entity record) m2 ())) # selectFirst :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> [SelectOpt record] -> ReaderT SqlWriteBackend m (Maybe (Entity record)) # selectKeysRes :: forall (m1 :: Type -> Type) (m2 :: Type -> Type) record. (MonadIO m1, MonadIO m2, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> [SelectOpt record] -> ReaderT SqlWriteBackend m1 (Acquire (ConduitM () (Key record) m2 ())) # count :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> ReaderT SqlWriteBackend m Int exists :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> ReaderT SqlWriteBackend m Bool | |
| PersistQueryRead SqlBackend | |
Defined in Database.Persist.Sql.Orphan.PersistQuery Methods selectSourceRes :: forall record (m1 :: Type -> Type) (m2 :: Type -> Type). (PersistRecordBackend record SqlBackend, MonadIO m1, MonadIO m2) => [Filter record] -> [SelectOpt record] -> ReaderT SqlBackend m1 (Acquire (ConduitM () (Entity record) m2 ())) # selectFirst :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlBackend) => [Filter record] -> [SelectOpt record] -> ReaderT SqlBackend m (Maybe (Entity record)) # selectKeysRes :: forall (m1 :: Type -> Type) (m2 :: Type -> Type) record. (MonadIO m1, MonadIO m2, PersistRecordBackend record SqlBackend) => [Filter record] -> [SelectOpt record] -> ReaderT SqlBackend m1 (Acquire (ConduitM () (Key record) m2 ())) # count :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlBackend) => [Filter record] -> ReaderT SqlBackend m Int exists :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlBackend) => [Filter record] -> ReaderT SqlBackend m Bool | |
class (PersistQueryRead backend, PersistStoreWrite backend) => PersistQueryWrite backend where #
Methods
updateWhere :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record backend) => [Filter record] -> [Update record] -> ReaderT backend m () #
deleteWhere :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record backend) => [Filter record] -> ReaderT backend m () #
Instances
| PersistQueryWrite SqlWriteBackend | |
Defined in Database.Persist.Sql.Orphan.PersistQuery Methods updateWhere :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> [Update record] -> ReaderT SqlWriteBackend m () # deleteWhere :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> ReaderT SqlWriteBackend m () # | |
| PersistQueryWrite SqlBackend | |
Defined in Database.Persist.Sql.Orphan.PersistQuery Methods updateWhere :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlBackend) => [Filter record] -> [Update record] -> ReaderT SqlBackend m () # deleteWhere :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlBackend) => [Filter record] -> ReaderT SqlBackend m () # | |
selectKeys :: forall record backend (m :: Type -> Type). (PersistQueryRead backend, MonadResource m, PersistRecordBackend record backend, MonadReader backend m) => [Filter record] -> [SelectOpt record] -> ConduitM () (Key record) m () #
class BackendCompatible sup sub where #
Methods
projectBackend :: sub -> sup #
Instances
| BackendCompatible SqlBackend SqlReadBackend | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods | |
| BackendCompatible SqlBackend SqlWriteBackend | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods | |
| BackendCompatible SqlBackend SqlBackend | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods projectBackend :: SqlBackend -> SqlBackend # | |
class PersistCore backend #
Associated Types
data BackendKey backend #
Instances
| PersistCore SqlReadBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
| |||||
| PersistCore SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
| |||||
| PersistCore SqlBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
| |||||
data family BackendKey backend #
Instances
| FromJSON (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseJSON :: Value -> Parser (BackendKey SqlReadBackend) parseJSONList :: Value -> Parser [BackendKey SqlReadBackend] omittedField :: Maybe (BackendKey SqlReadBackend) | |||||
| FromJSON (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseJSON :: Value -> Parser (BackendKey SqlWriteBackend) parseJSONList :: Value -> Parser [BackendKey SqlWriteBackend] omittedField :: Maybe (BackendKey SqlWriteBackend) | |||||
| FromJSON (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseJSON :: Value -> Parser (BackendKey SqlBackend) parseJSONList :: Value -> Parser [BackendKey SqlBackend] omittedField :: Maybe (BackendKey SqlBackend) | |||||
| ToJSON (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toJSON :: BackendKey SqlReadBackend -> Value toEncoding :: BackendKey SqlReadBackend -> Encoding toJSONList :: [BackendKey SqlReadBackend] -> Value toEncodingList :: [BackendKey SqlReadBackend] -> Encoding omitField :: BackendKey SqlReadBackend -> Bool | |||||
| ToJSON (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toJSON :: BackendKey SqlWriteBackend -> Value toEncoding :: BackendKey SqlWriteBackend -> Encoding toJSONList :: [BackendKey SqlWriteBackend] -> Value toEncodingList :: [BackendKey SqlWriteBackend] -> Encoding omitField :: BackendKey SqlWriteBackend -> Bool | |||||
| ToJSON (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toJSON :: BackendKey SqlBackend -> Value toEncoding :: BackendKey SqlBackend -> Encoding toJSONList :: [BackendKey SqlBackend] -> Value toEncodingList :: [BackendKey SqlBackend] -> Encoding omitField :: BackendKey SqlBackend -> Bool | |||||
| Bounded (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore | |||||
| Bounded (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore | |||||
| Bounded (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore | |||||
| Enum (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods succ :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend pred :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend toEnum :: Int -> BackendKey SqlReadBackend fromEnum :: BackendKey SqlReadBackend -> Int enumFrom :: BackendKey SqlReadBackend -> [BackendKey SqlReadBackend] enumFromThen :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> [BackendKey SqlReadBackend] enumFromTo :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> [BackendKey SqlReadBackend] enumFromThenTo :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> [BackendKey SqlReadBackend] | |||||
| Enum (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods succ :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend pred :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend toEnum :: Int -> BackendKey SqlWriteBackend fromEnum :: BackendKey SqlWriteBackend -> Int enumFrom :: BackendKey SqlWriteBackend -> [BackendKey SqlWriteBackend] enumFromThen :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> [BackendKey SqlWriteBackend] enumFromTo :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> [BackendKey SqlWriteBackend] enumFromThenTo :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> [BackendKey SqlWriteBackend] | |||||
| Enum (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods succ :: BackendKey SqlBackend -> BackendKey SqlBackend pred :: BackendKey SqlBackend -> BackendKey SqlBackend toEnum :: Int -> BackendKey SqlBackend fromEnum :: BackendKey SqlBackend -> Int enumFrom :: BackendKey SqlBackend -> [BackendKey SqlBackend] enumFromThen :: BackendKey SqlBackend -> BackendKey SqlBackend -> [BackendKey SqlBackend] enumFromTo :: BackendKey SqlBackend -> BackendKey SqlBackend -> [BackendKey SqlBackend] enumFromThenTo :: BackendKey SqlBackend -> BackendKey SqlBackend -> BackendKey SqlBackend -> [BackendKey SqlBackend] | |||||
| Generic (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
Methods from :: BackendKey SqlReadBackend -> Rep (BackendKey SqlReadBackend) x to :: Rep (BackendKey SqlReadBackend) x -> BackendKey SqlReadBackend | |||||
| Generic (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
Methods from :: BackendKey SqlWriteBackend -> Rep (BackendKey SqlWriteBackend) x to :: Rep (BackendKey SqlWriteBackend) x -> BackendKey SqlWriteBackend | |||||
| Generic (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
Methods from :: BackendKey SqlBackend -> Rep (BackendKey SqlBackend) x to :: Rep (BackendKey SqlBackend) x -> BackendKey SqlBackend | |||||
| Num (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods (+) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend (-) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend (*) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend negate :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend abs :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend signum :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend fromInteger :: Integer -> BackendKey SqlReadBackend | |||||
| Num (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods (+) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend (-) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend (*) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend negate :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend abs :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend signum :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend fromInteger :: Integer -> BackendKey SqlWriteBackend | |||||
| Num (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods (+) :: BackendKey SqlBackend -> BackendKey SqlBackend -> BackendKey SqlBackend (-) :: BackendKey SqlBackend -> BackendKey SqlBackend -> BackendKey SqlBackend (*) :: BackendKey SqlBackend -> BackendKey SqlBackend -> BackendKey SqlBackend negate :: BackendKey SqlBackend -> BackendKey SqlBackend abs :: BackendKey SqlBackend -> BackendKey SqlBackend signum :: BackendKey SqlBackend -> BackendKey SqlBackend fromInteger :: Integer -> BackendKey SqlBackend | |||||
| Read (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods readsPrec :: Int -> ReadS (BackendKey SqlReadBackend) readList :: ReadS [BackendKey SqlReadBackend] readPrec :: ReadPrec (BackendKey SqlReadBackend) readListPrec :: ReadPrec [BackendKey SqlReadBackend] | |||||
| Read (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods readsPrec :: Int -> ReadS (BackendKey SqlWriteBackend) readList :: ReadS [BackendKey SqlWriteBackend] readPrec :: ReadPrec (BackendKey SqlWriteBackend) readListPrec :: ReadPrec [BackendKey SqlWriteBackend] | |||||
| Read (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods readsPrec :: Int -> ReadS (BackendKey SqlBackend) readList :: ReadS [BackendKey SqlBackend] readPrec :: ReadPrec (BackendKey SqlBackend) readListPrec :: ReadPrec [BackendKey SqlBackend] | |||||
| Integral (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods quot :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend rem :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend div :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend mod :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend quotRem :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> (BackendKey SqlReadBackend, BackendKey SqlReadBackend) divMod :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> (BackendKey SqlReadBackend, BackendKey SqlReadBackend) toInteger :: BackendKey SqlReadBackend -> Integer | |||||
| Integral (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods quot :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend rem :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend div :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend mod :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend quotRem :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> (BackendKey SqlWriteBackend, BackendKey SqlWriteBackend) divMod :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> (BackendKey SqlWriteBackend, BackendKey SqlWriteBackend) toInteger :: BackendKey SqlWriteBackend -> Integer | |||||
| Integral (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods quot :: BackendKey SqlBackend -> BackendKey SqlBackend -> BackendKey SqlBackend rem :: BackendKey SqlBackend -> BackendKey SqlBackend -> BackendKey SqlBackend div :: BackendKey SqlBackend -> BackendKey SqlBackend -> BackendKey SqlBackend mod :: BackendKey SqlBackend -> BackendKey SqlBackend -> BackendKey SqlBackend quotRem :: BackendKey SqlBackend -> BackendKey SqlBackend -> (BackendKey SqlBackend, BackendKey SqlBackend) divMod :: BackendKey SqlBackend -> BackendKey SqlBackend -> (BackendKey SqlBackend, BackendKey SqlBackend) toInteger :: BackendKey SqlBackend -> Integer | |||||
| Real (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlReadBackend -> Rational | |||||
| Real (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlWriteBackend -> Rational | |||||
| Real (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlBackend -> Rational | |||||
| Show (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlReadBackend -> ShowS show :: BackendKey SqlReadBackend -> String showList :: [BackendKey SqlReadBackend] -> ShowS | |||||
| Show (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlWriteBackend -> ShowS show :: BackendKey SqlWriteBackend -> String showList :: [BackendKey SqlWriteBackend] -> ShowS | |||||
| Show (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlBackend -> ShowS show :: BackendKey SqlBackend -> String showList :: [BackendKey SqlBackend] -> ShowS | |||||
| Eq (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool (/=) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool | |||||
| Eq (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool (/=) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool | |||||
| Eq (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool (/=) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool | |||||
| Ord (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods compare :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Ordering (<) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool (<=) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool (>) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool (>=) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool max :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend min :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend | |||||
| Ord (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods compare :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Ordering (<) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool (<=) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool (>) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool (>=) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool max :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend min :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend | |||||
| Ord (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods compare :: BackendKey SqlBackend -> BackendKey SqlBackend -> Ordering (<) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool (<=) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool (>) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool (>=) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool max :: BackendKey SqlBackend -> BackendKey SqlBackend -> BackendKey SqlBackend min :: BackendKey SqlBackend -> BackendKey SqlBackend -> BackendKey SqlBackend | |||||
| FromHttpApiData (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseUrlPiece :: Text -> Either Text (BackendKey SqlReadBackend) parseHeader :: ByteString -> Either Text (BackendKey SqlReadBackend) parseQueryParam :: Text -> Either Text (BackendKey SqlReadBackend) | |||||
| FromHttpApiData (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseUrlPiece :: Text -> Either Text (BackendKey SqlWriteBackend) parseHeader :: ByteString -> Either Text (BackendKey SqlWriteBackend) parseQueryParam :: Text -> Either Text (BackendKey SqlWriteBackend) | |||||
| FromHttpApiData (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseUrlPiece :: Text -> Either Text (BackendKey SqlBackend) parseHeader :: ByteString -> Either Text (BackendKey SqlBackend) parseQueryParam :: Text -> Either Text (BackendKey SqlBackend) | |||||
| ToHttpApiData (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toUrlPiece :: BackendKey SqlReadBackend -> Text toEncodedUrlPiece :: BackendKey SqlReadBackend -> Builder toHeader :: BackendKey SqlReadBackend -> ByteString toQueryParam :: BackendKey SqlReadBackend -> Text toEncodedQueryParam :: BackendKey SqlReadBackend -> Builder | |||||
| ToHttpApiData (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toUrlPiece :: BackendKey SqlWriteBackend -> Text toEncodedUrlPiece :: BackendKey SqlWriteBackend -> Builder toHeader :: BackendKey SqlWriteBackend -> ByteString toQueryParam :: BackendKey SqlWriteBackend -> Text toEncodedQueryParam :: BackendKey SqlWriteBackend -> Builder | |||||
| ToHttpApiData (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toUrlPiece :: BackendKey SqlBackend -> Text toEncodedUrlPiece :: BackendKey SqlBackend -> Builder toHeader :: BackendKey SqlBackend -> ByteString toQueryParam :: BackendKey SqlBackend -> Text toEncodedQueryParam :: BackendKey SqlBackend -> Builder | |||||
| PathPiece (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlReadBackend) toPathPiece :: BackendKey SqlReadBackend -> Text | |||||
| PathPiece (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlWriteBackend) toPathPiece :: BackendKey SqlWriteBackend -> Text | |||||
| PathPiece (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlBackend) toPathPiece :: BackendKey SqlBackend -> Text | |||||
| PersistField (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlReadBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlReadBackend) # | |||||
| PersistField (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlWriteBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlWriteBackend) # | |||||
| PersistField (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlBackend) # | |||||
| PersistFieldSql (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlReadBackend) -> SqlType # | |||||
| PersistFieldSql (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlWriteBackend) -> SqlType # | |||||
| PersistFieldSql (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlBackend) -> SqlType # | |||||
| newtype BackendKey SqlReadBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore | |||||
| newtype BackendKey SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore | |||||
| newtype BackendKey SqlBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore | |||||
| type Rep (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlReadBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.17.1.0-CNr6HPZgY5e9DN7Ni1cM6v" 'True) (C1 ('MetaCons "SqlReadBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlReadBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64))) | |||||
| type Rep (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlWriteBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.17.1.0-CNr6HPZgY5e9DN7Ni1cM6v" 'True) (C1 ('MetaCons "SqlWriteBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlWriteBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64))) | |||||
| type Rep (BackendKey SqlBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.17.1.0-CNr6HPZgY5e9DN7Ni1cM6v" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64))) | |||||
class HasPersistBackend backend where #
Associated Types
type BaseBackend backend #
Methods
persistBackend :: backend -> BaseBackend backend #
Instances
| HasPersistBackend SqlReadBackend | |||||
Defined in Database.Persist.Sql.Types.Internal Associated Types
Methods persistBackend :: SqlReadBackend -> BaseBackend SqlReadBackend # | |||||
| HasPersistBackend SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Types.Internal Associated Types
Methods persistBackend :: SqlWriteBackend -> BaseBackend SqlWriteBackend # | |||||
| HasPersistBackend SqlBackend | |||||
Defined in Database.Persist.SqlBackend.Internal Associated Types
Methods | |||||
type family BaseBackend backend #
Instances
| type BaseBackend SqlReadBackend | |
Defined in Database.Persist.Sql.Types.Internal | |
| type BaseBackend SqlWriteBackend | |
Defined in Database.Persist.Sql.Types.Internal | |
| type BaseBackend SqlBackend | |
Defined in Database.Persist.SqlBackend.Internal | |
class HasPersistBackend backend => IsPersistBackend backend #
Minimal complete definition
mkPersistBackend
Instances
| IsPersistBackend SqlReadBackend | |
Defined in Database.Persist.Sql.Types.Internal Methods mkPersistBackend :: BaseBackend SqlReadBackend -> SqlReadBackend | |
| IsPersistBackend SqlWriteBackend | |
Defined in Database.Persist.Sql.Types.Internal Methods mkPersistBackend :: BaseBackend SqlWriteBackend -> SqlWriteBackend | |
| IsPersistBackend SqlBackend | |
Defined in Database.Persist.SqlBackend.Internal Methods | |
type PersistRecordBackend record backend = (PersistEntity record, PersistEntityBackend record ~ BaseBackend backend) #
class (Show (BackendKey backend), Read (BackendKey backend), Eq (BackendKey backend), Ord (BackendKey backend), PersistCore backend, PersistField (BackendKey backend), ToJSON (BackendKey backend), FromJSON (BackendKey backend)) => PersistStoreRead backend where #
Minimal complete definition
Methods
get :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Key record -> ReaderT backend m (Maybe record) #
getMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => [Key record] -> ReaderT backend m (Map (Key record) record) #
Instances
| PersistStoreRead SqlReadBackend | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods get :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlReadBackend) => Key record -> ReaderT SqlReadBackend m (Maybe record) # getMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlReadBackend) => [Key record] -> ReaderT SqlReadBackend m (Map (Key record) record) # | |
| PersistStoreRead SqlWriteBackend | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods get :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> ReaderT SqlWriteBackend m (Maybe record) # getMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Key record] -> ReaderT SqlWriteBackend m (Map (Key record) record) # | |
| PersistStoreRead SqlBackend | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods get :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => Key record -> ReaderT SqlBackend m (Maybe record) # getMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => [Key record] -> ReaderT SqlBackend m (Map (Key record) record) # | |
class (PersistEntity record, PersistEntityBackend record ~ backend, PersistCore backend) => ToBackendKey backend record where #
Methods
toBackendKey :: Key record -> BackendKey backend #
fromBackendKey :: BackendKey backend -> Key record #
belongsTo :: forall ent1 ent2 backend (m :: Type -> Type). (PersistStoreRead backend, PersistEntity ent1, PersistRecordBackend ent2 backend, MonadIO m) => (ent1 -> Maybe (Key ent2)) -> ent1 -> ReaderT backend m (Maybe ent2) #
belongsToJust :: forall ent1 ent2 backend (m :: Type -> Type). (PersistStoreRead backend, PersistEntity ent1, PersistRecordBackend ent2 backend, MonadIO m) => (ent1 -> Key ent2) -> ent1 -> ReaderT backend m ent2 #
getEntity :: forall e backend (m :: Type -> Type). (PersistStoreRead backend, PersistRecordBackend e backend, MonadIO m) => Key e -> ReaderT backend m (Maybe (Entity e)) #
getJust :: forall record backend (m :: Type -> Type). (PersistStoreRead backend, PersistRecordBackend record backend, MonadIO m) => Key record -> ReaderT backend m record #
getJustEntity :: forall record backend (m :: Type -> Type). (PersistEntityBackend record ~ BaseBackend backend, MonadIO m, PersistEntity record, PersistStoreRead backend) => Key record -> ReaderT backend m (Entity record) #
insertEntity :: forall e backend (m :: Type -> Type). (PersistStoreWrite backend, PersistRecordBackend e backend, SafeToInsert e, MonadIO m, HasCallStack) => e -> ReaderT backend m (Entity e) #
insertRecord :: forall record backend (m :: Type -> Type). (PersistEntityBackend record ~ BaseBackend backend, PersistEntity record, MonadIO m, PersistStoreWrite backend, SafeToInsert record, HasCallStack) => record -> ReaderT backend m record #
liftPersist :: (MonadIO m, MonadReader backend m) => ReaderT backend IO b -> m b #
withBaseBackend :: forall backend (m :: Type -> Type) a. HasPersistBackend backend => ReaderT (BaseBackend backend) m a -> ReaderT backend m a #
withCompatibleBackend :: forall sup sub (m :: Type -> Type) a. BackendCompatible sup sub => ReaderT sup m a -> ReaderT sub m a #
class PersistEntity record => AtLeastOneUniqueKey record where #
Methods
requireUniquesP :: record -> NonEmpty (Unique record) #
type MultipleUniqueKeysError ty = ((('Text "The entity " ':<>: 'ShowType ty) ':<>: 'Text " has multiple unique keys.") ':$$: ('Text "The function you are trying to call requires only a single " ':<>: 'Text "unique key.")) ':$$: (('Text "There is probably a variant of the function with 'By' " ':<>: 'Text "appended that will allow you to select a unique key ") ':<>: 'Text "for the operation.") #
type NoUniqueKeysError ty = (('Text "The entity " ':<>: 'ShowType ty) ':<>: 'Text " does not have any unique keys.") ':$$: ('Text "The function you are trying to call requires a unique key " ':<>: 'Text "to be defined on the entity.") #
class PersistStoreRead backend => PersistUniqueRead backend where #
Minimal complete definition
Methods
getBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Unique record -> ReaderT backend m (Maybe (Entity record)) #
existsBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend) => Unique record -> ReaderT backend m Bool #
Instances
| PersistUniqueRead SqlReadBackend | |
Defined in Database.Persist.Sql.Orphan.PersistUnique Methods getBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlReadBackend) => Unique record -> ReaderT SqlReadBackend m (Maybe (Entity record)) # existsBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlReadBackend) => Unique record -> ReaderT SqlReadBackend m Bool # | |
| PersistUniqueRead SqlWriteBackend | |
Defined in Database.Persist.Sql.Orphan.PersistUnique Methods getBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Unique record -> ReaderT SqlWriteBackend m (Maybe (Entity record)) # existsBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Unique record -> ReaderT SqlWriteBackend m Bool # | |
| PersistUniqueRead SqlBackend | |
Defined in Database.Persist.Sql.Orphan.PersistUnique Methods getBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => Unique record -> ReaderT SqlBackend m (Maybe (Entity record)) # existsBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlBackend) => Unique record -> ReaderT SqlBackend m Bool # | |
checkUnique :: forall record backend (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, PersistUniqueRead backend) => record -> ReaderT backend m (Maybe (Unique record)) #
checkUniqueUpdateable :: forall record backend (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, PersistUniqueRead backend) => Entity record -> ReaderT backend m (Maybe (Unique record)) #
getByValue :: forall record (m :: Type -> Type) backend. (MonadIO m, PersistUniqueRead backend, PersistRecordBackend record backend, AtLeastOneUniqueKey record) => record -> ReaderT backend m (Maybe (Entity record)) #
insertBy :: forall record backend (m :: Type -> Type). (MonadIO m, PersistUniqueWrite backend, PersistRecordBackend record backend, AtLeastOneUniqueKey record, SafeToInsert record) => record -> ReaderT backend m (Either (Entity record) (Key record)) #
insertUniqueEntity :: forall record backend (m :: Type -> Type). (MonadIO m, PersistRecordBackend record backend, PersistUniqueWrite backend, SafeToInsert record) => record -> ReaderT backend m (Maybe (Entity record)) #
onlyOneUniqueDef :: (OnlyOneUniqueKey record, Monad proxy) => proxy record -> UniqueDef #
onlyUnique :: forall record backend (m :: Type -> Type). (MonadIO m, PersistUniqueWrite backend, PersistRecordBackend record backend, OnlyOneUniqueKey record) => record -> ReaderT backend m (Unique record) #
replaceUnique :: forall record backend (m :: Type -> Type). (MonadIO m, Eq (Unique record), PersistRecordBackend record backend, PersistUniqueWrite backend) => Key record -> record -> ReaderT backend m (Maybe (Unique record)) #
getEntityComments :: EntityDef -> Maybe Text #
getEntityExtra :: EntityDef -> Map Text [[Text]] #
getEntityFields :: EntityDef -> [FieldDef] #
getEntityFieldsDatabase :: EntityDef -> [FieldDef] #
getEntityForeignDefs :: EntityDef -> [ForeignDef] #
getEntityId :: EntityDef -> EntityIdDef #
getEntityIdField :: EntityDef -> Maybe FieldDef #
getEntityKeyFields :: EntityDef -> NonEmpty FieldDef #
getEntitySpan :: EntityDef -> Maybe SourceSpan #
getEntityUniques :: EntityDef -> [UniqueDef] #
isEntitySum :: EntityDef -> Bool #
setEntityDBName :: EntityNameDB -> EntityDef -> EntityDef #
setEntityId :: FieldDef -> EntityDef -> EntityDef #
setEntityIdDef :: EntityIdDef -> EntityDef -> EntityDef #
addFieldAttr :: FieldAttr -> FieldDef -> FieldDef #
isFieldMaybe :: FieldDef -> Bool #
isFieldNullable :: FieldDef -> IsNullable #
setFieldAttrs :: [FieldAttr] -> FieldDef -> FieldDef #
newtype ConstraintNameHS #
Constructors
| ConstraintNameHS | |
Fields
| |
Instances
| Read ConstraintNameHS | |
Defined in Database.Persist.Names Methods readsPrec :: Int -> ReadS ConstraintNameHS readList :: ReadS [ConstraintNameHS] readPrec :: ReadPrec ConstraintNameHS readListPrec :: ReadPrec [ConstraintNameHS] | |
| Show ConstraintNameHS | |
Defined in Database.Persist.Names Methods showsPrec :: Int -> ConstraintNameHS -> ShowS show :: ConstraintNameHS -> String showList :: [ConstraintNameHS] -> ShowS | |
| Eq ConstraintNameHS | |
Defined in Database.Persist.Names Methods (==) :: ConstraintNameHS -> ConstraintNameHS -> Bool (/=) :: ConstraintNameHS -> ConstraintNameHS -> Bool | |
| Ord ConstraintNameHS | |
Defined in Database.Persist.Names Methods compare :: ConstraintNameHS -> ConstraintNameHS -> Ordering (<) :: ConstraintNameHS -> ConstraintNameHS -> Bool (<=) :: ConstraintNameHS -> ConstraintNameHS -> Bool (>) :: ConstraintNameHS -> ConstraintNameHS -> Bool (>=) :: ConstraintNameHS -> ConstraintNameHS -> Bool max :: ConstraintNameHS -> ConstraintNameHS -> ConstraintNameHS min :: ConstraintNameHS -> ConstraintNameHS -> ConstraintNameHS | |
| Lift ConstraintNameHS | |
Defined in Database.Persist.Names Methods lift :: Quote m => ConstraintNameHS -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => ConstraintNameHS -> Code m ConstraintNameHS | |
class DatabaseName a where #
Methods
escapeWith :: (Text -> str) -> a -> str #
Instances
| DatabaseName ConstraintNameDB | |
Defined in Database.Persist.Names Methods escapeWith :: (Text -> str) -> ConstraintNameDB -> str # | |
| DatabaseName EntityNameDB | |
Defined in Database.Persist.Names Methods escapeWith :: (Text -> str) -> EntityNameDB -> str # | |
| DatabaseName FieldNameDB | |
Defined in Database.Persist.Names Methods escapeWith :: (Text -> str) -> FieldNameDB -> str # | |
newtype EntityNameHS #
Constructors
| EntityNameHS | |
Fields
| |
Instances
| Read EntityNameHS | |
Defined in Database.Persist.Names Methods readsPrec :: Int -> ReadS EntityNameHS readList :: ReadS [EntityNameHS] readPrec :: ReadPrec EntityNameHS readListPrec :: ReadPrec [EntityNameHS] | |
| Show EntityNameHS | |
Defined in Database.Persist.Names Methods showsPrec :: Int -> EntityNameHS -> ShowS show :: EntityNameHS -> String showList :: [EntityNameHS] -> ShowS | |
| Eq EntityNameHS | |
Defined in Database.Persist.Names | |
| Ord EntityNameHS | |
Defined in Database.Persist.Names Methods compare :: EntityNameHS -> EntityNameHS -> Ordering (<) :: EntityNameHS -> EntityNameHS -> Bool (<=) :: EntityNameHS -> EntityNameHS -> Bool (>) :: EntityNameHS -> EntityNameHS -> Bool (>=) :: EntityNameHS -> EntityNameHS -> Bool max :: EntityNameHS -> EntityNameHS -> EntityNameHS min :: EntityNameHS -> EntityNameHS -> EntityNameHS | |
| Lift EntityNameHS | |
Defined in Database.Persist.Names Methods lift :: Quote m => EntityNameHS -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => EntityNameHS -> Code m EntityNameHS | |
newtype FieldNameHS #
Constructors
| FieldNameHS | |
Fields
| |
Instances
| Read FieldNameHS | |
Defined in Database.Persist.Names Methods readsPrec :: Int -> ReadS FieldNameHS readList :: ReadS [FieldNameHS] readPrec :: ReadPrec FieldNameHS readListPrec :: ReadPrec [FieldNameHS] | |
| Show FieldNameHS | |
Defined in Database.Persist.Names Methods showsPrec :: Int -> FieldNameHS -> ShowS show :: FieldNameHS -> String showList :: [FieldNameHS] -> ShowS | |
| Eq FieldNameHS | |
Defined in Database.Persist.Names | |
| Ord FieldNameHS | |
Defined in Database.Persist.Names Methods compare :: FieldNameHS -> FieldNameHS -> Ordering (<) :: FieldNameHS -> FieldNameHS -> Bool (<=) :: FieldNameHS -> FieldNameHS -> Bool (>) :: FieldNameHS -> FieldNameHS -> Bool (>=) :: FieldNameHS -> FieldNameHS -> Bool max :: FieldNameHS -> FieldNameHS -> FieldNameHS min :: FieldNameHS -> FieldNameHS -> FieldNameHS | |
| Lift FieldNameHS | |
Defined in Database.Persist.Names Methods lift :: Quote m => FieldNameHS -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => FieldNameHS -> Code m FieldNameHS | |
data LiteralType #
Constructors
| Escaped | |
| Unescaped | |
| DbSpecific |
Instances
| Read LiteralType | |
Defined in Database.Persist.PersistValue Methods readsPrec :: Int -> ReadS LiteralType readList :: ReadS [LiteralType] readPrec :: ReadPrec LiteralType readListPrec :: ReadPrec [LiteralType] | |
| Show LiteralType | |
Defined in Database.Persist.PersistValue Methods showsPrec :: Int -> LiteralType -> ShowS show :: LiteralType -> String showList :: [LiteralType] -> ShowS | |
| Eq LiteralType | |
Defined in Database.Persist.PersistValue | |
| Ord LiteralType | |
Defined in Database.Persist.PersistValue Methods compare :: LiteralType -> LiteralType -> Ordering (<) :: LiteralType -> LiteralType -> Bool (<=) :: LiteralType -> LiteralType -> Bool (>) :: LiteralType -> LiteralType -> Bool (>=) :: LiteralType -> LiteralType -> Bool max :: LiteralType -> LiteralType -> LiteralType min :: LiteralType -> LiteralType -> LiteralType | |
fromPersistValueText :: PersistValue -> Either Text Text #
newtype EntityWithPrefix (prefix :: Symbol) record #
Constructors
| EntityWithPrefix | |
Fields
| |
Instances
| (PersistEntity record, KnownSymbol prefix, PersistEntityBackend record ~ backend, IsPersistBackend backend) => RawSql (EntityWithPrefix prefix record) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> EntityWithPrefix prefix record -> (Int, [Text]) # rawSqlColCountReason :: EntityWithPrefix prefix record -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (EntityWithPrefix prefix record) # | |
class PersistField a => PersistFieldSql a where #
Instances
| PersistFieldSql Html | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql ByteString | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Int16 | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Int32 | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Int64 | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Int8 | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Rational | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Word16 | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Word32 | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Word64 | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Word8 | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql OverflowNatural | |
Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy OverflowNatural -> SqlType # | |
| PersistFieldSql PersistValue | |
Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy PersistValue -> SqlType # | |
| PersistFieldSql Checkmark | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Text | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Text | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Day | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql UTCTime | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql TimeOfDay | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Bool | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Double | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Int | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql Word | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql v => PersistFieldSql (IntMap v) | |
Defined in Database.Persist.Sql.Class | |
| (Ord a, PersistFieldSql a) => PersistFieldSql (Set a) | |
Defined in Database.Persist.Sql.Class | |
| (FromJSON a, ToJSON a) => PersistFieldSql (JSONB a) Source # | jsonb Since: 3.1.0 |
Defined in Database.Esqueleto.PostgreSQL.JSON.Instances | |
| (PersistField record, PersistEntity record) => PersistFieldSql (Entity record) | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql (BackendKey SqlReadBackend) | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlReadBackend) -> SqlType # | |
| PersistFieldSql (BackendKey SqlWriteBackend) | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlWriteBackend) -> SqlType # | |
| PersistFieldSql (BackendKey SqlBackend) | |
Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlBackend) -> SqlType # | |
| PersistFieldSql a => PersistFieldSql (Vector a) | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql a => PersistFieldSql (Maybe a) | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql [Char] | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql a => PersistFieldSql [a] | |
Defined in Database.Persist.Sql.Class | |
| HasResolution a => PersistFieldSql (Fixed a) | |
Defined in Database.Persist.Sql.Class | |
| PersistFieldSql v => PersistFieldSql (Map Text v) | |
Defined in Database.Persist.Sql.Class | |
| (PersistFieldSql a, PersistFieldSql b) => PersistFieldSql (a, b) | |
Defined in Database.Persist.Sql.Class | |
Methods
rawSqlCols :: (Text -> Text) -> a -> (Int, [Text]) #
rawSqlColCountReason :: a -> String #
rawSqlProcessRow :: [PersistValue] -> Either Text a #
Instances
| (PersistEntity record, PersistEntityBackend record ~ backend, IsPersistBackend backend) => RawSql (Entity record) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> Entity record -> (Int, [Text]) # rawSqlColCountReason :: Entity record -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (Entity record) # | |
| (PersistEntity a, PersistEntityBackend a ~ backend, IsPersistBackend backend) => RawSql (Key a) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> Key a -> (Int, [Text]) # rawSqlColCountReason :: Key a -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (Key a) # | |
| PersistField a => RawSql (Single a) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> Single a -> (Int, [Text]) # rawSqlColCountReason :: Single a -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (Single a) # | |
| RawSql a => RawSql (Maybe a) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> Maybe a -> (Int, [Text]) # rawSqlColCountReason :: Maybe a -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (Maybe a) # | |
| (PersistEntity record, KnownSymbol prefix, PersistEntityBackend record ~ backend, IsPersistBackend backend) => RawSql (EntityWithPrefix prefix record) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> EntityWithPrefix prefix record -> (Int, [Text]) # rawSqlColCountReason :: EntityWithPrefix prefix record -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (EntityWithPrefix prefix record) # | |
| (RawSql a, RawSql b) => RawSql (a, b) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b) -> (Int, [Text]) # rawSqlColCountReason :: (a, b) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b) # | |
| (RawSql a, RawSql b, RawSql c) => RawSql (a, b, c) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d) => RawSql (a, b, c, d) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e) => RawSql (a, b, c, d, e) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f) => RawSql (a, b, c, d, e, f) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g) => RawSql (a, b, c, d, e, f, g) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h) => RawSql (a, b, c, d, e, f, g, h) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i) => RawSql (a, b, c, d, e, f, g, h, i) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j) => RawSql (a, b, c, d, e, f, g, h, i, j) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k) => RawSql (a, b, c, d, e, f, g, h, i, j, k) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3, RawSql f3) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3, RawSql f3, RawSql g3) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3, RawSql f3, RawSql g3, RawSql h3) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3, RawSql f3, RawSql g3, RawSql h3, RawSql i3) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3, i3) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3, i3) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3, i3) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3, i3) # | |
| (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3, RawSql f3, RawSql g3, RawSql h3, RawSql i3, RawSql j3) => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3, i3, j3) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3, i3, j3) -> (Int, [Text]) # rawSqlColCountReason :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3, i3, j3) -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3, i3, j3) # | |
unPrefix :: forall (prefix :: Symbol) record. EntityWithPrefix prefix record -> Entity record #
defaultAttribute :: [FieldAttr] -> Maybe Text #
getBackendSpecificForeignKeyName :: BackendSpecificOverrides -> Maybe (EntityNameDB -> FieldNameDB -> ConstraintNameDB) #
mkColumns :: [EntityDef] -> EntityDef -> BackendSpecificOverrides -> ([Column], [UniqueDef], [ForeignDef]) #
setBackendSpecificForeignKeyName :: (EntityNameDB -> FieldNameDB -> ConstraintNameDB) -> BackendSpecificOverrides -> BackendSpecificOverrides #
type CautiousMigration = [(Bool, Sql)] #
type Migration = WriterT [Text] (WriterT CautiousMigration (ReaderT SqlBackend IO)) () #
newtype PersistUnsafeMigrationException #
Constructors
| PersistUnsafeMigrationException [(Bool, Sql)] |
Instances
| Exception PersistUnsafeMigrationException | |
Defined in Database.Persist.Sql.Migration Methods toException :: PersistUnsafeMigrationException -> SomeException fromException :: SomeException -> Maybe PersistUnsafeMigrationException displayException :: PersistUnsafeMigrationException -> String backtraceDesired :: PersistUnsafeMigrationException -> Bool | |
| Show PersistUnsafeMigrationException | |
Defined in Database.Persist.Sql.Migration Methods showsPrec :: Int -> PersistUnsafeMigrationException -> ShowS show :: PersistUnsafeMigrationException -> String showList :: [PersistUnsafeMigrationException] -> ShowS | |
addMigration :: Bool -> Sql -> Migration #
getMigration :: forall (m :: Type -> Type). (MonadIO m, HasCallStack) => Migration -> ReaderT SqlBackend m [Sql] #
parseMigration :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m (Either [Text] CautiousMigration) #
parseMigration' :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m CautiousMigration #
printMigration :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m () #
reportError :: Text -> Migration #
reportErrors :: [Text] -> Migration #
runMigration :: forall (m :: Type -> Type). MonadIO m => Migration -> ReaderT SqlBackend m () #
runMigrationQuiet :: forall (m :: Type -> Type). MonadIO m => Migration -> ReaderT SqlBackend m [Text] #
runMigrationSilent :: forall (m :: Type -> Type). MonadUnliftIO m => Migration -> ReaderT SqlBackend m [Text] #
runMigrationUnsafe :: forall (m :: Type -> Type). MonadIO m => Migration -> ReaderT SqlBackend m () #
runMigrationUnsafeQuiet :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m [Text] #
runSqlCommand :: SqlPersistT IO () -> Migration #
showMigration :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m [Text] #
data FilterTablePrefix #
Constructors
| PrefixTableName | |
| PrefixExcluded |
decorateSQLWithLimitOffset :: Text -> (Int, Int) -> Text -> Text #
filterClause :: PersistEntity val => Maybe FilterTablePrefix -> SqlBackend -> [Filter val] -> Text #
filterClauseWithVals :: PersistEntity val => Maybe FilterTablePrefix -> SqlBackend -> [Filter val] -> (Text, [PersistValue]) #
orderClause :: PersistEntity val => Maybe FilterTablePrefix -> SqlBackend -> [SelectOpt val] -> Text #
fieldDBName :: PersistEntity record => EntityField record typ -> FieldNameDB #
fromSqlKey :: ToBackendKey SqlBackend record => Key record -> Int64 #
getFieldName :: forall record typ (m :: Type -> Type) backend. (PersistEntity record, PersistEntityBackend record ~ SqlBackend, BackendCompatible SqlBackend backend, Monad m) => EntityField record typ -> ReaderT backend m Text #
getTableName :: forall record (m :: Type -> Type) backend. (PersistEntity record, BackendCompatible SqlBackend backend, Monad m) => record -> ReaderT backend m Text #
tableDBName :: PersistEntity record => record -> EntityNameDB #
toSqlKey :: ToBackendKey SqlBackend record => Int64 -> Key record #
withRawQuery :: forall (m :: Type -> Type) a. MonadIO m => Text -> [PersistValue] -> ConduitM [PersistValue] Void IO a -> ReaderT SqlBackend m a #
getStmtConn :: SqlBackend -> Text -> IO Statement #
rawExecute :: forall (m :: Type -> Type) backend. (MonadIO m, BackendCompatible SqlBackend backend) => Text -> [PersistValue] -> ReaderT backend m () #
rawExecuteCount :: forall (m :: Type -> Type) backend. (MonadIO m, BackendCompatible SqlBackend backend) => Text -> [PersistValue] -> ReaderT backend m Int64 #
rawQuery :: forall (m :: Type -> Type) env. (MonadResource m, MonadReader env m, BackendCompatible SqlBackend env) => Text -> [PersistValue] -> ConduitM () [PersistValue] m () #
rawQueryRes :: forall (m1 :: Type -> Type) (m2 :: Type -> Type) env. (MonadIO m1, MonadIO m2, BackendCompatible SqlBackend env) => Text -> [PersistValue] -> ReaderT env m1 (Acquire (ConduitM () [PersistValue] m2 ())) #
rawSql :: forall a (m :: Type -> Type) backend. (RawSql a, MonadIO m, BackendCompatible SqlBackend backend) => Text -> [PersistValue] -> ReaderT backend m [a] #
acquireSqlConn :: (MonadReader backend m, BackendCompatible SqlBackend backend) => m (Acquire backend) #
acquireSqlConnWithIsolation :: (MonadReader backend m, BackendCompatible SqlBackend backend) => IsolationLevel -> m (Acquire backend) #
close' :: BackendCompatible SqlBackend backend => backend -> IO () #
createSqlPool :: forall backend m. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> Int -> m (Pool backend) #
createSqlPoolWithConfig :: (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> ConnectionPoolConfig -> m (Pool backend) #
liftSqlPersistMPool :: forall backend m a. (MonadIO m, BackendCompatible SqlBackend backend) => ReaderT backend (NoLoggingT (ResourceT IO)) a -> Pool backend -> m a #
runSqlConn :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> backend -> m a #
runSqlConnWithIsolation :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> backend -> IsolationLevel -> m a #
runSqlPersistM :: BackendCompatible SqlBackend backend => ReaderT backend (NoLoggingT (ResourceT IO)) a -> backend -> IO a #
runSqlPersistMPool :: BackendCompatible SqlBackend backend => ReaderT backend (NoLoggingT (ResourceT IO)) a -> Pool backend -> IO a #
runSqlPool :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> m a #
runSqlPoolNoTransaction :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> m a #
runSqlPoolWithExtensibleHooks :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> SqlPoolHooks m backend -> m a #
runSqlPoolWithHooks :: forall backend m a before after onException. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> (backend -> m before) -> (backend -> m after) -> (backend -> SomeException -> m onException) -> m a #
runSqlPoolWithIsolation :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> IsolationLevel -> m a #
withSqlConn :: forall backend m a. (MonadUnliftIO m, MonadLoggerIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> (backend -> m a) -> m a #
withSqlPool :: forall backend m a. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> Int -> (Pool backend -> m a) -> m a #
withSqlPoolWithConfig :: forall backend m a. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> ConnectionPoolConfig -> (Pool backend -> m a) -> m a #
Constructors
| Column | |
Fields
| |
data ColumnReference #
Constructors
| ColumnReference | |
Fields | |
Instances
| Show ColumnReference | |
Defined in Database.Persist.Sql.Types Methods showsPrec :: Int -> ColumnReference -> ShowS show :: ColumnReference -> String showList :: [ColumnReference] -> ShowS | |
| Eq ColumnReference | |
Defined in Database.Persist.Sql.Types Methods (==) :: ColumnReference -> ColumnReference -> Bool (/=) :: ColumnReference -> ColumnReference -> Bool | |
| Ord ColumnReference | |
Defined in Database.Persist.Sql.Types Methods compare :: ColumnReference -> ColumnReference -> Ordering (<) :: ColumnReference -> ColumnReference -> Bool (<=) :: ColumnReference -> ColumnReference -> Bool (>) :: ColumnReference -> ColumnReference -> Bool (>=) :: ColumnReference -> ColumnReference -> Bool max :: ColumnReference -> ColumnReference -> ColumnReference min :: ColumnReference -> ColumnReference -> ColumnReference | |
type ConnectionPool = Pool SqlBackend #
data ConnectionPoolConfig #
Constructors
| ConnectionPoolConfig | |
Fields
| |
Instances
| Show ConnectionPoolConfig | |
Defined in Database.Persist.Sql.Types Methods showsPrec :: Int -> ConnectionPoolConfig -> ShowS show :: ConnectionPoolConfig -> String showList :: [ConnectionPoolConfig] -> ShowS | |
data PersistentSqlException #
Constructors
| StatementAlreadyFinalized Text | |
| Couldn'tGetSQLConnection |
Instances
| Exception PersistentSqlException | |
Defined in Database.Persist.Sql.Types Methods toException :: PersistentSqlException -> SomeException fromException :: SomeException -> Maybe PersistentSqlException displayException :: PersistentSqlException -> String backtraceDesired :: PersistentSqlException -> Bool | |
| Show PersistentSqlException | |
Defined in Database.Persist.Sql.Types Methods showsPrec :: Int -> PersistentSqlException -> ShowS show :: PersistentSqlException -> String showList :: [PersistentSqlException] -> ShowS | |
Instances
| Read a => Read (Single a) | |
Defined in Database.Persist.Sql.Types | |
| Show a => Show (Single a) | |
| Eq a => Eq (Single a) | |
| Ord a => Ord (Single a) | |
Defined in Database.Persist.Sql.Types | |
| PersistField a => RawSql (Single a) | |
Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> Single a -> (Int, [Text]) # rawSqlColCountReason :: Single a -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (Single a) # | |
type SqlPersistM = SqlPersistT (NoLoggingT (ResourceT IO)) #
type SqlPersistT = ReaderT SqlBackend #
type IsSqlBackend backend = (IsPersistBackend backend, BaseBackend backend ~ SqlBackend) #
type SqlBackendCanRead backend = (BackendCompatible SqlBackend backend, PersistQueryRead backend, PersistStoreRead backend, PersistUniqueRead backend) #
type SqlBackendCanWrite backend = (SqlBackendCanRead backend, PersistQueryWrite backend, PersistStoreWrite backend, PersistUniqueWrite backend) #
newtype SqlReadBackend #
Constructors
| SqlReadBackend | |
Fields | |
Instances
| PersistQueryRead SqlReadBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistQuery Methods selectSourceRes :: forall record (m1 :: Type -> Type) (m2 :: Type -> Type). (PersistRecordBackend record SqlReadBackend, MonadIO m1, MonadIO m2) => [Filter record] -> [SelectOpt record] -> ReaderT SqlReadBackend m1 (Acquire (ConduitM () (Entity record) m2 ())) # selectFirst :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlReadBackend) => [Filter record] -> [SelectOpt record] -> ReaderT SqlReadBackend m (Maybe (Entity record)) # selectKeysRes :: forall (m1 :: Type -> Type) (m2 :: Type -> Type) record. (MonadIO m1, MonadIO m2, PersistRecordBackend record SqlReadBackend) => [Filter record] -> [SelectOpt record] -> ReaderT SqlReadBackend m1 (Acquire (ConduitM () (Key record) m2 ())) # count :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlReadBackend) => [Filter record] -> ReaderT SqlReadBackend m Int exists :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlReadBackend) => [Filter record] -> ReaderT SqlReadBackend m Bool | |||||
| HasPersistBackend SqlReadBackend | |||||
Defined in Database.Persist.Sql.Types.Internal Associated Types
Methods persistBackend :: SqlReadBackend -> BaseBackend SqlReadBackend # | |||||
| IsPersistBackend SqlReadBackend | |||||
Defined in Database.Persist.Sql.Types.Internal Methods mkPersistBackend :: BaseBackend SqlReadBackend -> SqlReadBackend | |||||
| PersistCore SqlReadBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
| |||||
| PersistStoreRead SqlReadBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods get :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlReadBackend) => Key record -> ReaderT SqlReadBackend m (Maybe record) # getMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlReadBackend) => [Key record] -> ReaderT SqlReadBackend m (Map (Key record) record) # | |||||
| PersistUniqueRead SqlReadBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistUnique Methods getBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlReadBackend) => Unique record -> ReaderT SqlReadBackend m (Maybe (Entity record)) # existsBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlReadBackend) => Unique record -> ReaderT SqlReadBackend m Bool # | |||||
| BackendCompatible SqlBackend SqlReadBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods | |||||
| FromJSON (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseJSON :: Value -> Parser (BackendKey SqlReadBackend) parseJSONList :: Value -> Parser [BackendKey SqlReadBackend] omittedField :: Maybe (BackendKey SqlReadBackend) | |||||
| ToJSON (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toJSON :: BackendKey SqlReadBackend -> Value toEncoding :: BackendKey SqlReadBackend -> Encoding toJSONList :: [BackendKey SqlReadBackend] -> Value toEncodingList :: [BackendKey SqlReadBackend] -> Encoding omitField :: BackendKey SqlReadBackend -> Bool | |||||
| Bounded (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore | |||||
| Enum (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods succ :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend pred :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend toEnum :: Int -> BackendKey SqlReadBackend fromEnum :: BackendKey SqlReadBackend -> Int enumFrom :: BackendKey SqlReadBackend -> [BackendKey SqlReadBackend] enumFromThen :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> [BackendKey SqlReadBackend] enumFromTo :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> [BackendKey SqlReadBackend] enumFromThenTo :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> [BackendKey SqlReadBackend] | |||||
| Generic (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
Methods from :: BackendKey SqlReadBackend -> Rep (BackendKey SqlReadBackend) x to :: Rep (BackendKey SqlReadBackend) x -> BackendKey SqlReadBackend | |||||
| Num (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods (+) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend (-) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend (*) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend negate :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend abs :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend signum :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend fromInteger :: Integer -> BackendKey SqlReadBackend | |||||
| Read (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods readsPrec :: Int -> ReadS (BackendKey SqlReadBackend) readList :: ReadS [BackendKey SqlReadBackend] readPrec :: ReadPrec (BackendKey SqlReadBackend) readListPrec :: ReadPrec [BackendKey SqlReadBackend] | |||||
| Integral (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods quot :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend rem :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend div :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend mod :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend quotRem :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> (BackendKey SqlReadBackend, BackendKey SqlReadBackend) divMod :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> (BackendKey SqlReadBackend, BackendKey SqlReadBackend) toInteger :: BackendKey SqlReadBackend -> Integer | |||||
| Real (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlReadBackend -> Rational | |||||
| Show (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlReadBackend -> ShowS show :: BackendKey SqlReadBackend -> String showList :: [BackendKey SqlReadBackend] -> ShowS | |||||
| Eq (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool (/=) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool | |||||
| Ord (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods compare :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Ordering (<) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool (<=) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool (>) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool (>=) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool max :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend min :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> BackendKey SqlReadBackend | |||||
| FromHttpApiData (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseUrlPiece :: Text -> Either Text (BackendKey SqlReadBackend) parseHeader :: ByteString -> Either Text (BackendKey SqlReadBackend) parseQueryParam :: Text -> Either Text (BackendKey SqlReadBackend) | |||||
| ToHttpApiData (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toUrlPiece :: BackendKey SqlReadBackend -> Text toEncodedUrlPiece :: BackendKey SqlReadBackend -> Builder toHeader :: BackendKey SqlReadBackend -> ByteString toQueryParam :: BackendKey SqlReadBackend -> Text toEncodedQueryParam :: BackendKey SqlReadBackend -> Builder | |||||
| PathPiece (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlReadBackend) toPathPiece :: BackendKey SqlReadBackend -> Text | |||||
| PersistField (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlReadBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlReadBackend) # | |||||
| PersistFieldSql (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlReadBackend) -> SqlType # | |||||
| newtype BackendKey SqlReadBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore | |||||
| type BaseBackend SqlReadBackend | |||||
Defined in Database.Persist.Sql.Types.Internal | |||||
| type Rep (BackendKey SqlReadBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlReadBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.17.1.0-CNr6HPZgY5e9DN7Ni1cM6v" 'True) (C1 ('MetaCons "SqlReadBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlReadBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64))) | |||||
type SqlReadT (m :: Type -> Type) a = forall backend. SqlBackendCanRead backend => ReaderT backend m a #
newtype SqlWriteBackend #
Constructors
| SqlWriteBackend | |
Fields | |
Instances
| PersistQueryRead SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistQuery Methods selectSourceRes :: forall record (m1 :: Type -> Type) (m2 :: Type -> Type). (PersistRecordBackend record SqlWriteBackend, MonadIO m1, MonadIO m2) => [Filter record] -> [SelectOpt record] -> ReaderT SqlWriteBackend m1 (Acquire (ConduitM () (Entity record) m2 ())) # selectFirst :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> [SelectOpt record] -> ReaderT SqlWriteBackend m (Maybe (Entity record)) # selectKeysRes :: forall (m1 :: Type -> Type) (m2 :: Type -> Type) record. (MonadIO m1, MonadIO m2, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> [SelectOpt record] -> ReaderT SqlWriteBackend m1 (Acquire (ConduitM () (Key record) m2 ())) # count :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> ReaderT SqlWriteBackend m Int exists :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> ReaderT SqlWriteBackend m Bool | |||||
| PersistQueryWrite SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistQuery Methods updateWhere :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> [Update record] -> ReaderT SqlWriteBackend m () # deleteWhere :: forall (m :: Type -> Type) record. (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Filter record] -> ReaderT SqlWriteBackend m () # | |||||
| HasPersistBackend SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Types.Internal Associated Types
Methods persistBackend :: SqlWriteBackend -> BaseBackend SqlWriteBackend # | |||||
| IsPersistBackend SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Types.Internal Methods mkPersistBackend :: BaseBackend SqlWriteBackend -> SqlWriteBackend | |||||
| PersistCore SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
| |||||
| PersistStoreRead SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods get :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> ReaderT SqlWriteBackend m (Maybe record) # getMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Key record] -> ReaderT SqlWriteBackend m (Map (Key record) record) # | |||||
| PersistStoreWrite SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods insert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => record -> ReaderT SqlWriteBackend m (Key record) # insert_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => record -> ReaderT SqlWriteBackend m () # insertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => [record] -> ReaderT SqlWriteBackend m [Key record] # insertMany_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => [record] -> ReaderT SqlWriteBackend m () # insertEntityMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [Entity record] -> ReaderT SqlWriteBackend m () # insertKey :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> record -> ReaderT SqlWriteBackend m () # repsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> record -> ReaderT SqlWriteBackend m () # repsertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => [(Key record, record)] -> ReaderT SqlWriteBackend m () # replace :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> record -> ReaderT SqlWriteBackend m () # delete :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> ReaderT SqlWriteBackend m () update :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> [Update record] -> ReaderT SqlWriteBackend m () updateGet :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Key record -> [Update record] -> ReaderT SqlWriteBackend m record # | |||||
| PersistUniqueRead SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistUnique Methods getBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Unique record -> ReaderT SqlWriteBackend m (Maybe (Entity record)) # existsBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Unique record -> ReaderT SqlWriteBackend m Bool # | |||||
| PersistUniqueWrite SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistUnique Methods deleteBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend) => Unique record -> ReaderT SqlWriteBackend m () # insertUnique :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => record -> ReaderT SqlWriteBackend m (Maybe (Key record)) # insertUnique_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => record -> ReaderT SqlWriteBackend m (Maybe ()) # upsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, OnlyOneUniqueKey record, SafeToInsert record) => record -> [Update record] -> ReaderT SqlWriteBackend m (Entity record) # upsertBy :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => Unique record -> record -> [Update record] -> ReaderT SqlWriteBackend m (Entity record) # putMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record SqlWriteBackend, SafeToInsert record) => [record] -> ReaderT SqlWriteBackend m () # | |||||
| BackendCompatible SqlBackend SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods | |||||
| FromJSON (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseJSON :: Value -> Parser (BackendKey SqlWriteBackend) parseJSONList :: Value -> Parser [BackendKey SqlWriteBackend] omittedField :: Maybe (BackendKey SqlWriteBackend) | |||||
| ToJSON (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toJSON :: BackendKey SqlWriteBackend -> Value toEncoding :: BackendKey SqlWriteBackend -> Encoding toJSONList :: [BackendKey SqlWriteBackend] -> Value toEncodingList :: [BackendKey SqlWriteBackend] -> Encoding omitField :: BackendKey SqlWriteBackend -> Bool | |||||
| Bounded (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore | |||||
| Enum (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods succ :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend pred :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend toEnum :: Int -> BackendKey SqlWriteBackend fromEnum :: BackendKey SqlWriteBackend -> Int enumFrom :: BackendKey SqlWriteBackend -> [BackendKey SqlWriteBackend] enumFromThen :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> [BackendKey SqlWriteBackend] enumFromTo :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> [BackendKey SqlWriteBackend] enumFromThenTo :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> [BackendKey SqlWriteBackend] | |||||
| Generic (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
Methods from :: BackendKey SqlWriteBackend -> Rep (BackendKey SqlWriteBackend) x to :: Rep (BackendKey SqlWriteBackend) x -> BackendKey SqlWriteBackend | |||||
| Num (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods (+) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend (-) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend (*) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend negate :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend abs :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend signum :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend fromInteger :: Integer -> BackendKey SqlWriteBackend | |||||
| Read (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods readsPrec :: Int -> ReadS (BackendKey SqlWriteBackend) readList :: ReadS [BackendKey SqlWriteBackend] readPrec :: ReadPrec (BackendKey SqlWriteBackend) readListPrec :: ReadPrec [BackendKey SqlWriteBackend] | |||||
| Integral (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods quot :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend rem :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend div :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend mod :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend quotRem :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> (BackendKey SqlWriteBackend, BackendKey SqlWriteBackend) divMod :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> (BackendKey SqlWriteBackend, BackendKey SqlWriteBackend) toInteger :: BackendKey SqlWriteBackend -> Integer | |||||
| Real (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlWriteBackend -> Rational | |||||
| Show (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlWriteBackend -> ShowS show :: BackendKey SqlWriteBackend -> String showList :: [BackendKey SqlWriteBackend] -> ShowS | |||||
| Eq (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool (/=) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool | |||||
| Ord (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods compare :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Ordering (<) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool (<=) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool (>) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool (>=) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool max :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend min :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend | |||||
| FromHttpApiData (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseUrlPiece :: Text -> Either Text (BackendKey SqlWriteBackend) parseHeader :: ByteString -> Either Text (BackendKey SqlWriteBackend) parseQueryParam :: Text -> Either Text (BackendKey SqlWriteBackend) | |||||
| ToHttpApiData (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toUrlPiece :: BackendKey SqlWriteBackend -> Text toEncodedUrlPiece :: BackendKey SqlWriteBackend -> Builder toHeader :: BackendKey SqlWriteBackend -> ByteString toQueryParam :: BackendKey SqlWriteBackend -> Text toEncodedQueryParam :: BackendKey SqlWriteBackend -> Builder | |||||
| PathPiece (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlWriteBackend) toPathPiece :: BackendKey SqlWriteBackend -> Text | |||||
| PersistField (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlWriteBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlWriteBackend) # | |||||
| PersistFieldSql (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlWriteBackend) -> SqlType # | |||||
| newtype BackendKey SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore | |||||
| type BaseBackend SqlWriteBackend | |||||
Defined in Database.Persist.Sql.Types.Internal | |||||
| type Rep (BackendKey SqlWriteBackend) | |||||
Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlWriteBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.17.1.0-CNr6HPZgY5e9DN7Ni1cM6v" 'True) (C1 ('MetaCons "SqlWriteBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlWriteBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64))) | |||||
type SqlWriteT (m :: Type -> Type) a = forall backend. SqlBackendCanWrite backend => ReaderT backend m a #
readToUnknown :: forall (m :: Type -> Type) a. Monad m => ReaderT SqlReadBackend m a -> ReaderT SqlBackend m a #
readToWrite :: forall (m :: Type -> Type) a. Monad m => ReaderT SqlReadBackend m a -> ReaderT SqlWriteBackend m a #
writeToUnknown :: forall (m :: Type -> Type) a. Monad m => ReaderT SqlWriteBackend m a -> ReaderT SqlBackend m a #
data InsertSqlResult #
Constructors
| ISRSingle Text | |
| ISRInsertGet Text Text | |
| ISRManyKeys Text [PersistValue] |
data IsolationLevel #
Constructors
| ReadUncommitted | |
| ReadCommitted | |
| RepeatableRead | |
| Serializable |
Instances
| Bounded IsolationLevel | |
| Enum IsolationLevel | |
Defined in Database.Persist.SqlBackend.Internal.IsolationLevel Methods succ :: IsolationLevel -> IsolationLevel pred :: IsolationLevel -> IsolationLevel toEnum :: Int -> IsolationLevel fromEnum :: IsolationLevel -> Int enumFrom :: IsolationLevel -> [IsolationLevel] enumFromThen :: IsolationLevel -> IsolationLevel -> [IsolationLevel] enumFromTo :: IsolationLevel -> IsolationLevel -> [IsolationLevel] enumFromThenTo :: IsolationLevel -> IsolationLevel -> IsolationLevel -> [IsolationLevel] | |
| Show IsolationLevel | |
Defined in Database.Persist.SqlBackend.Internal.IsolationLevel Methods showsPrec :: Int -> IsolationLevel -> ShowS show :: IsolationLevel -> String showList :: [IsolationLevel] -> ShowS | |
| Eq IsolationLevel | |
Defined in Database.Persist.SqlBackend.Internal.IsolationLevel Methods (==) :: IsolationLevel -> IsolationLevel -> Bool (/=) :: IsolationLevel -> IsolationLevel -> Bool | |
| Ord IsolationLevel | |
Defined in Database.Persist.SqlBackend.Internal.IsolationLevel Methods compare :: IsolationLevel -> IsolationLevel -> Ordering (<) :: IsolationLevel -> IsolationLevel -> Bool (<=) :: IsolationLevel -> IsolationLevel -> Bool (>) :: IsolationLevel -> IsolationLevel -> Bool (>=) :: IsolationLevel -> IsolationLevel -> Bool max :: IsolationLevel -> IsolationLevel -> IsolationLevel min :: IsolationLevel -> IsolationLevel -> IsolationLevel | |
Constructors
| Statement | |
Fields
| |
Instances
| Bounded Checkmark | |
Defined in Database.Persist.Types.Base | |
| Enum Checkmark | |
Defined in Database.Persist.Types.Base | |
| Read Checkmark | |
Defined in Database.Persist.Types.Base | |
| Show Checkmark | |
| Eq Checkmark | |
| Ord Checkmark | |
Defined in Database.Persist.Types.Base | |
| FromHttpApiData Checkmark | |
Defined in Database.Persist.Types.Base Methods parseUrlPiece :: Text -> Either Text Checkmark parseHeader :: ByteString -> Either Text Checkmark parseQueryParam :: Text -> Either Text Checkmark | |
| ToHttpApiData Checkmark | |
Defined in Database.Persist.Types.Base Methods toUrlPiece :: Checkmark -> Text toEncodedUrlPiece :: Checkmark -> Builder toHeader :: Checkmark -> ByteString toQueryParam :: Checkmark -> Text toEncodedQueryParam :: Checkmark -> Builder | |
| PathPiece Checkmark | |
Defined in Database.Persist.Types.Base | |
| PersistField Checkmark | |
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: Checkmark -> PersistValue # fromPersistValue :: PersistValue -> Either Text Checkmark # | |
| PersistFieldSql Checkmark | |
Defined in Database.Persist.Sql.Class | |
data WhyNullable #
Constructors
| ByMaybeAttr | |
| ByNullableAttr |
Instances
| Show WhyNullable | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> WhyNullable -> ShowS show :: WhyNullable -> String showList :: [WhyNullable] -> ShowS | |
| Eq WhyNullable | |
Defined in Database.Persist.Types.Base | |
data CascadeAction #
Constructors
| Cascade | |
| Restrict | |
| SetNull | |
| SetDefault |
Instances
| Read CascadeAction | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS CascadeAction readList :: ReadS [CascadeAction] readPrec :: ReadPrec CascadeAction readListPrec :: ReadPrec [CascadeAction] | |
| Show CascadeAction | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> CascadeAction -> ShowS show :: CascadeAction -> String showList :: [CascadeAction] -> ShowS | |
| Eq CascadeAction | |
Defined in Database.Persist.Types.Base | |
| Ord CascadeAction | |
Defined in Database.Persist.Types.Base Methods compare :: CascadeAction -> CascadeAction -> Ordering (<) :: CascadeAction -> CascadeAction -> Bool (<=) :: CascadeAction -> CascadeAction -> Bool (>) :: CascadeAction -> CascadeAction -> Bool (>=) :: CascadeAction -> CascadeAction -> Bool max :: CascadeAction -> CascadeAction -> CascadeAction min :: CascadeAction -> CascadeAction -> CascadeAction | |
| Lift CascadeAction | |
Defined in Database.Persist.Types.Base Methods lift :: Quote m => CascadeAction -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => CascadeAction -> Code m CascadeAction | |
data CompositeDef #
Constructors
| CompositeDef | |
Fields
| |
Instances
| Read CompositeDef | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS CompositeDef readList :: ReadS [CompositeDef] readPrec :: ReadPrec CompositeDef readListPrec :: ReadPrec [CompositeDef] | |
| Show CompositeDef | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> CompositeDef -> ShowS show :: CompositeDef -> String showList :: [CompositeDef] -> ShowS | |
| Eq CompositeDef | |
Defined in Database.Persist.Types.Base | |
| Ord CompositeDef | |
Defined in Database.Persist.Types.Base Methods compare :: CompositeDef -> CompositeDef -> Ordering (<) :: CompositeDef -> CompositeDef -> Bool (<=) :: CompositeDef -> CompositeDef -> Bool (>) :: CompositeDef -> CompositeDef -> Bool (>=) :: CompositeDef -> CompositeDef -> Bool max :: CompositeDef -> CompositeDef -> CompositeDef min :: CompositeDef -> CompositeDef -> CompositeDef | |
| Lift CompositeDef | |
Defined in Database.Persist.Types.Base Methods lift :: Quote m => CompositeDef -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => CompositeDef -> Code m CompositeDef | |
data EmbedEntityDef #
Constructors
| EmbedEntityDef | |
Fields | |
Instances
| Read EmbedEntityDef | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS EmbedEntityDef readList :: ReadS [EmbedEntityDef] readPrec :: ReadPrec EmbedEntityDef readListPrec :: ReadPrec [EmbedEntityDef] | |
| Show EmbedEntityDef | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> EmbedEntityDef -> ShowS show :: EmbedEntityDef -> String showList :: [EmbedEntityDef] -> ShowS | |
| Eq EmbedEntityDef | |
Defined in Database.Persist.Types.Base Methods (==) :: EmbedEntityDef -> EmbedEntityDef -> Bool (/=) :: EmbedEntityDef -> EmbedEntityDef -> Bool | |
| Ord EmbedEntityDef | |
Defined in Database.Persist.Types.Base Methods compare :: EmbedEntityDef -> EmbedEntityDef -> Ordering (<) :: EmbedEntityDef -> EmbedEntityDef -> Bool (<=) :: EmbedEntityDef -> EmbedEntityDef -> Bool (>) :: EmbedEntityDef -> EmbedEntityDef -> Bool (>=) :: EmbedEntityDef -> EmbedEntityDef -> Bool max :: EmbedEntityDef -> EmbedEntityDef -> EmbedEntityDef min :: EmbedEntityDef -> EmbedEntityDef -> EmbedEntityDef | |
| Lift EmbedEntityDef | |
Defined in Database.Persist.Types.Base Methods lift :: Quote m => EmbedEntityDef -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => EmbedEntityDef -> Code m EmbedEntityDef | |
data EmbedFieldDef #
Constructors
| EmbedFieldDef | |
Fields
| |
Instances
| Read EmbedFieldDef | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS EmbedFieldDef readList :: ReadS [EmbedFieldDef] readPrec :: ReadPrec EmbedFieldDef readListPrec :: ReadPrec [EmbedFieldDef] | |
| Show EmbedFieldDef | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> EmbedFieldDef -> ShowS show :: EmbedFieldDef -> String showList :: [EmbedFieldDef] -> ShowS | |
| Eq EmbedFieldDef | |
Defined in Database.Persist.Types.Base | |
| Ord EmbedFieldDef | |
Defined in Database.Persist.Types.Base Methods compare :: EmbedFieldDef -> EmbedFieldDef -> Ordering (<) :: EmbedFieldDef -> EmbedFieldDef -> Bool (<=) :: EmbedFieldDef -> EmbedFieldDef -> Bool (>) :: EmbedFieldDef -> EmbedFieldDef -> Bool (>=) :: EmbedFieldDef -> EmbedFieldDef -> Bool max :: EmbedFieldDef -> EmbedFieldDef -> EmbedFieldDef min :: EmbedFieldDef -> EmbedFieldDef -> EmbedFieldDef | |
| Lift EmbedFieldDef | |
Defined in Database.Persist.Types.Base Methods lift :: Quote m => EmbedFieldDef -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => EmbedFieldDef -> Code m EmbedFieldDef | |
data ReferenceDef #
Constructors
| NoReference | |
| ForeignRef !EntityNameHS | |
| EmbedRef EntityNameHS | |
| SelfReference |
Instances
| Read ReferenceDef | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS ReferenceDef readList :: ReadS [ReferenceDef] readPrec :: ReadPrec ReferenceDef readListPrec :: ReadPrec [ReferenceDef] | |
| Show ReferenceDef | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> ReferenceDef -> ShowS show :: ReferenceDef -> String showList :: [ReferenceDef] -> ShowS | |
| Eq ReferenceDef | |
Defined in Database.Persist.Types.Base | |
| Ord ReferenceDef | |
Defined in Database.Persist.Types.Base Methods compare :: ReferenceDef -> ReferenceDef -> Ordering (<) :: ReferenceDef -> ReferenceDef -> Bool (<=) :: ReferenceDef -> ReferenceDef -> Bool (>) :: ReferenceDef -> ReferenceDef -> Bool (>=) :: ReferenceDef -> ReferenceDef -> Bool max :: ReferenceDef -> ReferenceDef -> ReferenceDef min :: ReferenceDef -> ReferenceDef -> ReferenceDef | |
| Lift ReferenceDef | |
Defined in Database.Persist.Types.Base Methods lift :: Quote m => ReferenceDef -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => ReferenceDef -> Code m ReferenceDef | |
Instances
| Read EntityDef | |
Defined in Database.Persist.Types.Base | |
| Show EntityDef | |
| Eq EntityDef | |
| Ord EntityDef | |
Defined in Database.Persist.Types.Base | |
| Lift EntityDef | |
data EntityIdDef #
Constructors
| EntityIdField !FieldDef | |
| EntityIdNaturalKey !CompositeDef |
Instances
| Read EntityIdDef | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS EntityIdDef readList :: ReadS [EntityIdDef] readPrec :: ReadPrec EntityIdDef readListPrec :: ReadPrec [EntityIdDef] | |
| Show EntityIdDef | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> EntityIdDef -> ShowS show :: EntityIdDef -> String showList :: [EntityIdDef] -> ShowS | |
| Eq EntityIdDef | |
Defined in Database.Persist.Types.Base | |
| Ord EntityIdDef | |
Defined in Database.Persist.Types.Base Methods compare :: EntityIdDef -> EntityIdDef -> Ordering (<) :: EntityIdDef -> EntityIdDef -> Bool (<=) :: EntityIdDef -> EntityIdDef -> Bool (>) :: EntityIdDef -> EntityIdDef -> Bool (>=) :: EntityIdDef -> EntityIdDef -> Bool max :: EntityIdDef -> EntityIdDef -> EntityIdDef min :: EntityIdDef -> EntityIdDef -> EntityIdDef | |
| Lift EntityIdDef | |
Defined in Database.Persist.Types.Base Methods lift :: Quote m => EntityIdDef -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => EntityIdDef -> Code m EntityIdDef | |
Constructors
| FTTypeCon (Maybe Text) Text | |
| FTLit FieldTypeLit | |
| FTTypePromoted Text | |
| FTApp FieldType FieldType | |
| FTList FieldType |
Instances
| Read FieldType | |
Defined in Database.Persist.Types.Base | |
| Show FieldType | |
| Eq FieldType | |
| Ord FieldType | |
Defined in Database.Persist.Types.Base | |
| Lift FieldType | |
Constructors
| FieldAttrMaybe | |
| FieldAttrNullable | |
| FieldAttrMigrationOnly | |
| FieldAttrSafeToRemove | |
| FieldAttrNoreference | |
| FieldAttrReference Text | |
| FieldAttrConstraint Text | |
| FieldAttrDefault Text | |
| FieldAttrSqltype Text | |
| FieldAttrMaxlen Integer | |
| FieldAttrSql Text | |
| FieldAttrOther Text |
Instances
| Read FieldAttr | |
Defined in Database.Persist.Types.Base | |
| Show FieldAttr | |
| Eq FieldAttr | |
| Ord FieldAttr | |
Defined in Database.Persist.Types.Base | |
| Lift FieldAttr | |
data FieldCascade #
Constructors
| FieldCascade | |
Fields
| |
Instances
| Read FieldCascade | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS FieldCascade readList :: ReadS [FieldCascade] readPrec :: ReadPrec FieldCascade readListPrec :: ReadPrec [FieldCascade] | |
| Show FieldCascade | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> FieldCascade -> ShowS show :: FieldCascade -> String showList :: [FieldCascade] -> ShowS | |
| Eq FieldCascade | |
Defined in Database.Persist.Types.Base | |
| Ord FieldCascade | |
Defined in Database.Persist.Types.Base Methods compare :: FieldCascade -> FieldCascade -> Ordering (<) :: FieldCascade -> FieldCascade -> Bool (<=) :: FieldCascade -> FieldCascade -> Bool (>) :: FieldCascade -> FieldCascade -> Bool (>=) :: FieldCascade -> FieldCascade -> Bool max :: FieldCascade -> FieldCascade -> FieldCascade min :: FieldCascade -> FieldCascade -> FieldCascade | |
| Lift FieldCascade | |
Defined in Database.Persist.Types.Base Methods lift :: Quote m => FieldCascade -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => FieldCascade -> Code m FieldCascade | |
Constructors
| FieldDef | |
Fields
| |
Instances
| Read FieldDef | |
Defined in Database.Persist.Types.Base | |
| Show FieldDef | |
| Eq FieldDef | |
| Ord FieldDef | |
Defined in Database.Persist.Types.Base | |
| Lift FieldDef | |
data ForeignDef #
Constructors
| ForeignDef | |
Fields
| |
Instances
| Read ForeignDef | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS ForeignDef readList :: ReadS [ForeignDef] readPrec :: ReadPrec ForeignDef readListPrec :: ReadPrec [ForeignDef] | |
| Show ForeignDef | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> ForeignDef -> ShowS show :: ForeignDef -> String showList :: [ForeignDef] -> ShowS | |
| Eq ForeignDef | |
Defined in Database.Persist.Types.Base | |
| Ord ForeignDef | |
Defined in Database.Persist.Types.Base Methods compare :: ForeignDef -> ForeignDef -> Ordering (<) :: ForeignDef -> ForeignDef -> Bool (<=) :: ForeignDef -> ForeignDef -> Bool (>) :: ForeignDef -> ForeignDef -> Bool (>=) :: ForeignDef -> ForeignDef -> Bool max :: ForeignDef -> ForeignDef -> ForeignDef min :: ForeignDef -> ForeignDef -> ForeignDef | |
| Lift ForeignDef | |
Defined in Database.Persist.Types.Base Methods lift :: Quote m => ForeignDef -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => ForeignDef -> Code m ForeignDef | |
type ForeignFieldDef = (FieldNameHS, FieldNameDB) #
data UpdateException #
Constructors
| KeyNotFound String | |
| UpsertError String |
Instances
| Exception UpdateException | |
Defined in Database.Persist.Types.Base Methods toException :: UpdateException -> SomeException fromException :: SomeException -> Maybe UpdateException displayException :: UpdateException -> String backtraceDesired :: UpdateException -> Bool | |
| Show UpdateException | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> UpdateException -> ShowS show :: UpdateException -> String showList :: [UpdateException] -> ShowS | |
data PersistException #
Constructors
| PersistError Text | |
| PersistMarshalError Text | |
| PersistInvalidField Text | |
| PersistForeignConstraintUnmet Text | |
| PersistMongoDBError Text | |
| PersistMongoDBUnsupported Text |
Instances
| Exception PersistException | |
Defined in Database.Persist.Types.Base Methods toException :: PersistException -> SomeException fromException :: SomeException -> Maybe PersistException displayException :: PersistException -> String backtraceDesired :: PersistException -> Bool | |
| Show PersistException | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> PersistException -> ShowS show :: PersistException -> String showList :: [PersistException] -> ShowS | |
entitiesPrimary :: EntityDef -> NonEmpty FieldDef #
entityPrimary :: EntityDef -> Maybe CompositeDef #
isFieldNotGenerated :: FieldDef -> Bool #
isHaskellField :: FieldDef -> Bool #
keyAndEntityFields :: EntityDef -> NonEmpty FieldDef #
keyAndEntityFieldsDatabase :: EntityDef -> NonEmpty FieldDef #
parseFieldAttrs :: [Text] -> [FieldAttr] #
renderCascadeAction :: CascadeAction -> Text #
renderFieldCascade :: FieldCascade -> Text #
transactionSave :: forall (m :: Type -> Type). MonadIO m => ReaderT SqlBackend m () #
transactionSaveWithIsolation :: forall (m :: Type -> Type). MonadIO m => IsolationLevel -> ReaderT SqlBackend m () #
transactionUndo :: forall (m :: Type -> Type). MonadIO m => ReaderT SqlBackend m () #
transactionUndoWithIsolation :: forall (m :: Type -> Type). MonadIO m => IsolationLevel -> ReaderT SqlBackend m () #