Database.Persist.Sql

persistent-2.14.6.3: Type-safe, multi-backend data serialization.

Safe Haskell | None
Language | Haskell2010

Database.Persist.Sql

Contents

- `RawSql` and `PersistFieldSql`
- Running actions
- Migrations
- `persistent` combinators
- The Escape Hatch
- SQL helpers
- Transactions
- Other utilities
- Internal

Description

This module is the primary entry point if you're working with `persistent` on a SQL database.

# Getting Started

First, you'll want to define your database entities. You can do that with "Database.Persist.Quasi."

Then, you'll use the operations

Synopsis

- class PersistField a => PersistFieldSql a where
  - sqlType :: Proxy a -> SqlType
- class RawSql a where
  - rawSqlCols :: (Text -> Text) -> a -> (Int, [Text])
  - rawSqlColCountReason :: a -> String
  - rawSqlProcessRow :: [PersistValue] -> Either Text a
- newtype EntityWithPrefix (prefix :: Symbol) record = EntityWithPrefix {
  - unEntityWithPrefix :: Entity record
  }
- unPrefix :: forall (prefix :: Symbol) record. EntityWithPrefix prefix record -> Entity record
- close' :: BackendCompatible SqlBackend backend => backend -> IO ()
- runSqlPool :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> m a
- runSqlConn :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> backend -> m a
- runSqlPoolWithIsolation :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> IsolationLevel -> m a
- runSqlPoolNoTransaction :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> 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
- runSqlPoolWithExtensibleHooks :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> SqlPoolHooks m backend -> m a
- acquireSqlConn :: (MonadReader backend m, BackendCompatible SqlBackend backend) => m (Acquire backend)
- acquireSqlConnWithIsolation :: (MonadReader backend m, BackendCompatible SqlBackend backend) => IsolationLevel -> m (Acquire backend)
- 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
- liftSqlPersistMPool :: forall backend m a. (MonadIO m, BackendCompatible SqlBackend backend) => ReaderT backend (NoLoggingT (ResourceT IO)) a -> Pool backend -> 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
- createSqlPoolWithConfig :: (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> ConnectionPoolConfig -> m (Pool backend)
- createSqlPool :: forall backend m. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> Int -> m (Pool backend)
- withSqlConn :: forall backend m a. (MonadUnliftIO m, MonadLoggerIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> (backend -> m a) -> m a
- module Database.Persist.Sql.Migration
- module Database.Persist
- data family BackendKey backend
- data family BackendKey backend
- withRawQuery :: forall (m :: Type -> Type) a. MonadIO m => Text -> [PersistValue] -> ConduitM [PersistValue] Void IO a -> ReaderT SqlBackend m a
- toSqlKey :: ToBackendKey SqlBackend record => Int64 -> Key record
- 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
- fieldDBName :: PersistEntity record => EntityField record typ -> FieldNameDB
- 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 ()))
- 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
- rawSql :: forall a (m :: Type -> Type) backend. (RawSql a, MonadIO m, BackendCompatible SqlBackend backend) => Text -> [PersistValue] -> ReaderT backend m [a]
- deleteWhereCount :: forall val (m :: Type -> Type) backend. (PersistEntity val, MonadIO m, PersistEntityBackend val ~ SqlBackend, BackendCompatible SqlBackend backend) => [Filter val] -> ReaderT backend m Int64
- updateWhereCount :: forall val (m :: Type -> Type) backend. (PersistEntity val, MonadIO m, SqlBackend ~ PersistEntityBackend val, BackendCompatible SqlBackend backend) => [Filter val] -> [Update val] -> ReaderT backend m Int64
- 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
- data FilterTablePrefix
  - = PrefixTableName
  - | PrefixExcluded
- 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 ()
- getStmtConn :: SqlBackend -> Text -> IO Statement
- mkColumns :: [EntityDef] -> EntityDef -> BackendSpecificOverrides -> ([Column], [UniqueDef], [ForeignDef])
- data BackendSpecificOverrides
- emptyBackendSpecificOverrides :: BackendSpecificOverrides
- getBackendSpecificForeignKeyName :: BackendSpecificOverrides -> Maybe (EntityNameDB -> FieldNameDB -> ConstraintNameDB)
- setBackendSpecificForeignKeyName :: (EntityNameDB -> FieldNameDB -> ConstraintNameDB) -> BackendSpecificOverrides -> BackendSpecificOverrides
- defaultAttribute :: [FieldAttr] -> Maybe Text
- data IsolationLevel
  - = ReadUncommitted
  - | ReadCommitted
  - | RepeatableRead
  - | Serializable
- decorateSQLWithLimitOffset :: Text -> (Int, Int) -> Text -> Text
- newtype Single a = Single {
  - unSingle :: 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)
  }
- newtype OverflowNatural = OverflowNatural {
  - unOverflowNatural :: Natural
  }
- data SqlBackend
- newtype SqlReadBackend = SqlReadBackend {
  - unSqlReadBackend :: SqlBackend
  }
- newtype SqlWriteBackend = SqlWriteBackend {
  - unSqlWriteBackend :: SqlBackend
  }
- 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
- type LogFunc = Loc -> LogSource -> LogLevel -> LogStr -> IO ()
- data InsertSqlResult
  - = ISRSingle Text
  - | ISRInsertGet Text Text
  - | ISRManyKeys Text [PersistValue]
- data Statement = Statement {
  - stmtFinalize :: IO ()
  - stmtReset :: IO ()
  - stmtExecute :: [PersistValue] -> IO Int64
  - stmtQuery :: forall (m :: Type -> Type). MonadIO m => [PersistValue] -> Acquire (ConduitM () [PersistValue] m ())
  }
- type SqlBackendCanRead backend = (BackendCompatible SqlBackend backend, PersistQueryRead backend, PersistStoreRead backend, PersistUniqueRead backend)
- type SqlBackendCanWrite backend = (SqlBackendCanRead backend, PersistQueryWrite backend, PersistStoreWrite backend, PersistUniqueWrite backend)
- type SqlReadT (m :: Type -> Type) a = forall backend. SqlBackendCanRead backend => ReaderT backend m a
- type SqlWriteT (m :: Type -> Type) a = forall backend. SqlBackendCanWrite backend => ReaderT backend m a
- type IsSqlBackend backend = (IsPersistBackend backend, BaseBackend backend ~ SqlBackend)
- data ConnectionPoolConfig = ConnectionPoolConfig {
  - connectionPoolConfigStripes :: Int
  - connectionPoolConfigIdleTimeout :: NominalDiffTime
  - connectionPoolConfigSize :: Int
  }
- type ConnectionPool = Pool SqlBackend
- type SqlPersistT = ReaderT SqlBackend
- data ColumnReference = ColumnReference {
  - crTableName :: !EntityNameDB
  - crConstraintName :: !ConstraintNameDB
  - crFieldCascade :: !FieldCascade
  }
- data PersistentSqlException
  - = StatementAlreadyFinalized Text
  - | Couldn'tGetSQLConnection
- type SqlPersistM = SqlPersistT (NoLoggingT (ResourceT IO))
- defaultConnectionPoolConfig :: ConnectionPoolConfig

# `RawSql` and `PersistFieldSql`

class PersistField a => PersistFieldSql a where #

Tells Persistent what database column type should be used to store a Haskell type.

#### Examples

Expand

##### Simple Boolean Alternative

    data Switch = On | Off
      deriving (Show, Eq)

    instance PersistField Switch where
      toPersistValue s = case s of
        On -> PersistBool True
        Off -> PersistBool False
      fromPersistValue (PersistBool b) = if b then Right On else Right Off
      fromPersistValue x = Left $ "File.hs: When trying to deserialize a Switch: expected PersistBool, received: " <> T.pack (show x)

    instance PersistFieldSql Switch where
      sqlType _ = SqlBool

##### Non-Standard Database Types

If your database supports non-standard types, such as Postgres' `uuid`, you can use `SqlOther` to use them:

    import qualified Data.UUID as UUID
    instance PersistField UUID where
      toPersistValue = PersistLiteralEncoded . toASCIIBytes
      fromPersistValue (PersistLiteralEncoded uuid) =
        case fromASCIIBytes uuid of
          Nothing -> Left $ "Model/CustomTypes.hs: Failed to deserialize a UUID; received: " <> T.pack (show uuid)
          Just uuid' -> Right uuid'
      fromPersistValue x = Left $ "File.hs: When trying to deserialize a UUID: expected PersistLiteralEncoded, received: "-- >  <> T.pack (show x)

    instance PersistFieldSql UUID where
      sqlType _ = SqlOther "uuid"

##### User Created Database Types

Similarly, some databases support creating custom types, e.g. Postgres' DOMAIN and ENUM features. You can use `SqlOther` to specify a custom type:

    CREATE DOMAIN ssn AS text
          CHECK ( value ~ '^[0-9]{9}$');

    instance PersistFieldSQL SSN where
      sqlType _ = SqlOther "ssn"

    CREATE TYPE rainbow_color AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet');

    instance PersistFieldSQL RainbowColor where
      sqlType _ = SqlOther "rainbow_color"

Methods

sqlType :: Proxy a -> SqlType #

#### Instances

Instances details

PersistFieldSql Html # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Html -> SqlType #
PersistFieldSql ByteString # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy ByteString -> SqlType #
PersistFieldSql Int16 # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Int16 -> SqlType #
PersistFieldSql Int32 # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Int32 -> SqlType #
PersistFieldSql Int64 # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Int64 -> SqlType #
PersistFieldSql Int8 # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Int8 -> SqlType #
PersistFieldSql Rational # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Rational -> SqlType #
PersistFieldSql Word16 # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Word16 -> SqlType #
PersistFieldSql Word32 # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Word32 -> SqlType #
PersistFieldSql Word64 # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Word64 -> SqlType #
PersistFieldSql Word8 # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Word8 -> SqlType #
PersistFieldSql OverflowNatural # | This type uses the `SqlInt64` version, which will exhibit overflow and underflow behavior. Additionally, it permits negative values in the database, which isn't ideal. Since: 2.11.0
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy OverflowNatural -> SqlType #
PersistFieldSql PersistValue # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy PersistValue -> SqlType #
PersistFieldSql Checkmark # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Checkmark -> SqlType #
PersistFieldSql Text # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Text -> SqlType #
PersistFieldSql Text # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Text -> SqlType #
PersistFieldSql Day # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Day -> SqlType #
PersistFieldSql UTCTime # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy UTCTime -> SqlType #
PersistFieldSql TimeOfDay # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy TimeOfDay -> SqlType #
PersistFieldSql Bool # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Bool -> SqlType #
PersistFieldSql Double # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Double -> SqlType #
PersistFieldSql Int # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Int -> SqlType #
PersistFieldSql Word # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy Word -> SqlType #
PersistFieldSql v => PersistFieldSql (IntMap v) # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy (IntMap v) -> SqlType #
(Ord a, PersistFieldSql a) => PersistFieldSql (Set a) # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy (Set a) -> SqlType #
(PersistField record, PersistEntity record) => PersistFieldSql (Entity record) # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy (Entity record) -> SqlType #
(BackendCompatible b s, PersistFieldSql (BackendKey b)) => PersistFieldSql (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods sqlType :: Proxy (BackendKey (Compatible b s)) -> SqlType #
PersistFieldSql (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlReadBackend) -> SqlType #
PersistFieldSql (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlWriteBackend) -> SqlType #
PersistFieldSql (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlBackend) -> SqlType #
PersistFieldSql a => PersistFieldSql (Vector a) # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy (Vector a) -> SqlType #
PersistFieldSql a => PersistFieldSql (Maybe a) # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy (Maybe a) -> SqlType #
PersistFieldSql [Char] # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy [Char] -> SqlType #
PersistFieldSql a => PersistFieldSql [a] # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy [a] -> SqlType #
HasResolution a => PersistFieldSql (Fixed a) # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy (Fixed a) -> SqlType #
PersistFieldSql v => PersistFieldSql (Map Text v) # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy (Map Text v) -> SqlType #
(PersistFieldSql a, PersistFieldSql b) => PersistFieldSql (a, b) # |
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy (a, b) -> SqlType #

class RawSql a where #

Class for data types that may be retrived from a `rawSql` query.

Methods

rawSqlCols :: (Text -> Text) -> a -> (Int, [Text]) #

Number of columns that this data type needs and the list of substitutions for `SELECT` placeholders `??`.

rawSqlColCountReason :: a -> String #

A string telling the user why the column count is what it is.

rawSqlProcessRow :: [PersistValue] -> Either Text a #

Transform a row of the result into the data type.

#### Instances

Instances details

(PersistEntity record, PersistEntityBackend record ~ backend, IsPersistBackend backend) => RawSql (Entity record) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # | Since: 1.0.1
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # | Since: 2.10.2
Instance details 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) # | Since: 2.10.2
Instance details 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) # | Since: 2.10.2
Instance details 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) # | Since: 2.10.2
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) # | Since: 2.11.0
Instance details 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) #

newtype EntityWithPrefix (prefix :: Symbol) record #

This newtype wrapper is useful when selecting an entity out of the database and you want to provide a prefix to the table being selected.

Consider this raw SQL query:

    SELECT ??
    FROM my_long_table_name AS mltn
    INNER JOIN other_table AS ot
       ON mltn.some_col = ot.other_col
    WHERE ...

We don't want to refer to `my_long_table_name` every time, so we create an alias. If we want to select it, we have to tell the raw SQL quasi-quoter that we expect the entity to be prefixed with some other name.

We can give the above query a type with this, like:

    getStuff :: SqlPersistM [EntityWithPrefix "mltn" MyLongTableName]
    getStuff = rawSql queryText []

The `EntityWithPrefix` bit is a boilerplate newtype wrapper, so you can remove it with `unPrefix`, like this:

    getStuff :: SqlPersistM [Entity MyLongTableName]
    getStuff = unPrefix @"mltn" <$> rawSql queryText []

The `symbol is a "type application" and requires the` TypeApplications@ language extension.

Since: 2.10.5

Constructors

EntityWithPrefix |
Fields unEntityWithPrefix :: Entity record

#### Instances

Instances details

(PersistEntity record, KnownSymbol prefix, PersistEntityBackend record ~ backend, IsPersistBackend backend) => RawSql (EntityWithPrefix prefix record) # |
Instance details 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) #

unPrefix :: forall (prefix :: Symbol) record. EntityWithPrefix prefix record -> Entity record #

A helper function to tell GHC what the `EntityWithPrefix` prefix should be. This allows you to use a type application to specify the prefix, instead of specifying the etype on the result.

As an example, here's code that uses this:

    myQuery :: SqlPersistM [Entity Person]
    myQuery = fmap (unPrefix @"p") $ rawSql query []
      where
        query = "SELECT ?? FROM person AS p"

Since: 2.10.5

# Running actions

Run actions in a transaction with `runSqlPool`.

close' :: BackendCompatible SqlBackend backend => backend -> IO () #

runSqlPool :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> m a #

Get a connection from the pool, run the given action, and then return the connection to the pool.

This function performs the given action in a transaction. If an exception occurs during the action, then the transaction is rolled back.

Note: This function previously timed out after 2 seconds, but this behavior was buggy and caused more problems than it solved. Since version 2.1.2, it performs no timeout checks.

runSqlConn :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> backend -> m a #

runSqlPoolWithIsolation :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> IsolationLevel -> m a #

Like `runSqlPool`, but supports specifying an isolation level.

Since: 2.9.0

runSqlPoolNoTransaction :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> m a #

Like `runSqlPool`, but does not surround the action in a transaction. This action might leave your database in a weird state.

Since: 2.12.0.0

runSqlPoolWithHooks #

Arguments

:: forall backend m a before after onException. (MonadUnliftIO m, BackendCompatible SqlBackend backend) |
=> ReaderT backend m a |
-> Pool backend |
-> Maybe IsolationLevel |
-> (backend -> m before) | Run this action immediately before the action is performed.
-> (backend -> m after) | Run this action immediately after the action is completed.
-> (backend -> SomeException -> m onException) | This action is performed when an exception is received. The exception is provided as a convenience - it is rethrown once this cleanup function is complete.
-> m a |

This function is how `runSqlPool` and `runSqlPoolNoTransaction` are defined. In addition to the action to be performed and the `Pool` of conections to use, we give you the opportunity to provide three actions - initialize, afterwards, and onException.

Since: 2.12.0.0

runSqlPoolWithExtensibleHooks :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> SqlPoolHooks m backend -> m a #

This function is how `runSqlPoolWithHooks` is defined.

It's currently the most general function for using a SQL pool.

Since: 2.13.0.0

acquireSqlConn :: (MonadReader backend m, BackendCompatible SqlBackend backend) => m (Acquire backend) #

Starts a new transaction on the connection. When the acquired connection is released the transaction is committed and the connection returned to the pool.

Upon an exception the transaction is rolled back and the connection destroyed.

This is equivalent to `runSqlConn` but does not incur the `MonadUnliftIO` constraint, meaning it can be used within, for example, a `Conduit` pipeline.

Since: 2.10.5

acquireSqlConnWithIsolation :: (MonadReader backend m, BackendCompatible SqlBackend backend) => IsolationLevel -> m (Acquire backend) #

Like `acquireSqlConn`, but lets you specify an explicit isolation level.

Since: 2.10.5

runSqlConnWithIsolation :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> backend -> IsolationLevel -> m a #

Like `runSqlConn`, but supports specifying an isolation level.

Since: 2.9.0

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 #

liftSqlPersistMPool :: forall backend m a. (MonadIO m, BackendCompatible SqlBackend backend) => ReaderT backend (NoLoggingT (ResourceT IO)) a -> Pool backend -> m a #

withSqlPool #

Arguments

:: forall backend m a. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) |
=> (LogFunc -> IO backend) | create a new connection
-> Int | connection count
-> (Pool backend -> m a) |
-> m a |

withSqlPoolWithConfig #

Arguments

:: forall backend m a. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) |
=> (LogFunc -> IO backend) | Function to create a new connection
-> ConnectionPoolConfig |
-> (Pool backend -> m a) |
-> m a |

Creates a pool of connections to a SQL database which can be used by the `Pool backend -> m a` function. After the function completes, the connections are destroyed.

Since: 2.11.0.0

createSqlPoolWithConfig #

Arguments

:: (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) |
=> (LogFunc -> IO backend) | Function to create a new connection
-> ConnectionPoolConfig |
-> m (Pool backend) |

Creates a pool of connections to a SQL database.

Since: 2.11.0.0

createSqlPool :: forall backend m. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> Int -> m (Pool backend) #

withSqlConn :: forall backend m a. (MonadUnliftIO m, MonadLoggerIO m, BackendCompatible SqlBackend backend) => (LogFunc -> IO backend) -> (backend -> m a) -> m a #

Create a connection and run sql queries within it. This function automatically closes the connection on it's completion.

### Example usage

Expand

    {-# LANGUAGE GADTs #-}
    {-# LANGUAGE ScopedTypeVariables #-}
    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE MultiParamTypeClasses #-}
    {-# LANGUAGE TypeFamilies#-}
    {-# LANGUAGE TemplateHaskell#-}
    {-# LANGUAGE QuasiQuotes#-}
    {-# LANGUAGE GeneralizedNewtypeDeriving #-}

    import Control.Monad.IO.Class  (liftIO)
    import Control.Monad.Logger
    import Conduit
    import Database.Persist
    import Database.Sqlite
    import Database.Persist.Sqlite
    import Database.Persist.TH

    share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
    Person
      name String
      age Int Maybe
      deriving Show
    |]

    openConnection :: LogFunc -> IO SqlBackend
    openConnection logfn = do
     conn <- open "/home/sibi/test.db"
     wrapConnection conn logfn

    main :: IO ()
    main = do
      runNoLoggingT $ runResourceT $ withSqlConn openConnection (\backend ->
                                          flip runSqlConn backend $ do
                                            runMigration migrateAll
                                            insert_ $ Person "John doe" $ Just 35
                                            insert_ $ Person "Divya" $ Just 36
                                            (pers :: [Entity Person]) <- selectList [] []
                                            liftIO $ print pers
                                            return ()
                                         )

On executing it, you get this output:

    Migrating: CREATE TABLE "person"("id" INTEGER PRIMARY KEY,"name" VARCHAR NOT NULL,"age" INTEGER NULL)
    [Entity {entityKey = PersonKey {unPersonKey = SqlBackendKey {unSqlBackendKey = 1}}, entityVal = Person {personName = "John doe", personAge = Just 35}},Entity {entityKey = PersonKey {unPersonKey = SqlBackendKey {unSqlBackendKey = 2}}, entityVal = Person {personName = "Hema", personAge = Just 36}}]

# Migrations

module Database.Persist.Sql.Migration

# `persistent` combinators

We re-export Database.Persist here, to make it easier to use query and update combinators. Check out that module for documentation.

module Database.Persist

data family BackendKey backend #

#### Instances

Instances details

(BackendCompatible b s, FromJSON (BackendKey b)) => FromJSON (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods parseJSON :: Value -> Parser (BackendKey (Compatible b s)) # parseJSONList :: Value -> Parser [BackendKey (Compatible b s)] # omittedField :: Maybe (BackendKey (Compatible b s)) #
FromJSON (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseJSON :: Value -> Parser (BackendKey SqlBackend) # parseJSONList :: Value -> Parser [BackendKey SqlBackend] # omittedField :: Maybe (BackendKey SqlBackend) #
(BackendCompatible b s, ToJSON (BackendKey b)) => ToJSON (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods toJSON :: BackendKey (Compatible b s) -> Value # toEncoding :: BackendKey (Compatible b s) -> Encoding # toJSONList :: [BackendKey (Compatible b s)] -> Value # toEncodingList :: [BackendKey (Compatible b s)] -> Encoding # omitField :: BackendKey (Compatible b s) -> Bool #
ToJSON (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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 #
(BackendCompatible b s, Bounded (BackendKey b)) => Bounded (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods minBound :: BackendKey (Compatible b s) # maxBound :: BackendKey (Compatible b s) #
Bounded (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods minBound :: BackendKey SqlReadBackend # maxBound :: BackendKey SqlReadBackend #
Bounded (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods minBound :: BackendKey SqlWriteBackend # maxBound :: BackendKey SqlWriteBackend #
Bounded (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods minBound :: BackendKey SqlBackend # maxBound :: BackendKey SqlBackend #
(BackendCompatible b s, Enum (BackendKey b)) => Enum (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods succ :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) # pred :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) # toEnum :: Int -> BackendKey (Compatible b s) # fromEnum :: BackendKey (Compatible b s) -> Int # enumFrom :: BackendKey (Compatible b s) -> [BackendKey (Compatible b s)] # enumFromThen :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> [BackendKey (Compatible b s)] # enumFromTo :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> [BackendKey (Compatible b s)] # enumFromThenTo :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> [BackendKey (Compatible b s)] #
Enum (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
type Rep (BackendKey SqlReadBackend) |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlReadBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlReadBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlReadBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
Methods from :: BackendKey SqlReadBackend -> Rep (BackendKey SqlReadBackend) x # to :: Rep (BackendKey SqlReadBackend) x -> BackendKey SqlReadBackend #
Generic (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
type Rep (BackendKey SqlWriteBackend) |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlWriteBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlWriteBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlWriteBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
Methods from :: BackendKey SqlWriteBackend -> Rep (BackendKey SqlWriteBackend) x # to :: Rep (BackendKey SqlWriteBackend) x -> BackendKey SqlWriteBackend #
Generic (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
type Rep (BackendKey SqlBackend) |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
Methods from :: BackendKey SqlBackend -> Rep (BackendKey SqlBackend) x # to :: Rep (BackendKey SqlBackend) x -> BackendKey SqlBackend #
(BackendCompatible b s, Num (BackendKey b)) => Num (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods (+) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # (-) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # (*) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # negate :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) # abs :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) # signum :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) # fromInteger :: Integer -> BackendKey (Compatible b s) #
Num (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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 #
(BackendCompatible b s, Read (BackendKey b)) => Read (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods readsPrec :: Int -> ReadS (BackendKey (Compatible b s)) # readList :: ReadS [BackendKey (Compatible b s)] # readPrec :: ReadPrec (BackendKey (Compatible b s)) # readListPrec :: ReadPrec [BackendKey (Compatible b s)] #
Read (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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] #
(BackendCompatible b s, Integral (BackendKey b)) => Integral (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods quot :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # rem :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # div :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # mod :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # quotRem :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> (BackendKey (Compatible b s), BackendKey (Compatible b s)) # divMod :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> (BackendKey (Compatible b s), BackendKey (Compatible b s)) # toInteger :: BackendKey (Compatible b s) -> Integer #
Integral (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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 #
(BackendCompatible b s, Real (BackendKey b)) => Real (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods toRational :: BackendKey (Compatible b s) -> Rational #
Real (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlReadBackend -> Rational #
Real (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlWriteBackend -> Rational #
Real (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlBackend -> Rational #
(BackendCompatible b s, Show (BackendKey b)) => Show (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods showsPrec :: Int -> BackendKey (Compatible b s) -> ShowS # show :: BackendKey (Compatible b s) -> String # showList :: [BackendKey (Compatible b s)] -> ShowS #
Show (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlReadBackend -> ShowS # show :: BackendKey SqlReadBackend -> String # showList :: [BackendKey SqlReadBackend] -> ShowS #
Show (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlWriteBackend -> ShowS # show :: BackendKey SqlWriteBackend -> String # showList :: [BackendKey SqlWriteBackend] -> ShowS #
Show (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlBackend -> ShowS # show :: BackendKey SqlBackend -> String # showList :: [BackendKey SqlBackend] -> ShowS #
(BackendCompatible b s, Eq (BackendKey b)) => Eq (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods (==) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool # (/=) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool #
Eq (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool # (/=) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool #
Eq (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool # (/=) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool #
Eq (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool # (/=) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool #
(BackendCompatible b s, Ord (BackendKey b)) => Ord (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods compare :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Ordering # (<) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool # (<=) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool # (>) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool # (>=) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool # max :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # min :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) #
Ord (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlReadBackend) # toPathPiece :: BackendKey SqlReadBackend -> Text #
PathPiece (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlWriteBackend) # toPathPiece :: BackendKey SqlWriteBackend -> Text #
PathPiece (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlBackend) # toPathPiece :: BackendKey SqlBackend -> Text #
(BackendCompatible b s, PersistField (BackendKey b)) => PersistField (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods toPersistValue :: BackendKey (Compatible b s) -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey (Compatible b s)) #
PersistField (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlReadBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlReadBackend) #
PersistField (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlWriteBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlWriteBackend) #
PersistField (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlBackend) #
(BackendCompatible b s, PersistFieldSql (BackendKey b)) => PersistFieldSql (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods sqlType :: Proxy (BackendKey (Compatible b s)) -> SqlType #
PersistFieldSql (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlReadBackend) -> SqlType #
PersistFieldSql (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlWriteBackend) -> SqlType #
PersistFieldSql (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlBackend) -> SqlType #
newtype BackendKey SqlReadBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlReadBackend = SqlReadBackendKey { unSqlReadBackendKey :: Int64 }
newtype BackendKey SqlWriteBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlWriteBackend = SqlWriteBackendKey { unSqlWriteBackendKey :: Int64 }
newtype BackendKey SqlBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlBackend = SqlBackendKey { unSqlBackendKey :: Int64 }
type Rep (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlReadBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlReadBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlReadBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
type Rep (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlWriteBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlWriteBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlWriteBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
type Rep (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
newtype BackendKey (Compatible b s) # |
Instance details Defined in Database.Persist.Compatible.Types newtype BackendKey (Compatible b s) = CompatibleKey { unCompatibleKey :: BackendKey b }

data family BackendKey backend #

#### Instances

Instances details

(BackendCompatible b s, FromJSON (BackendKey b)) => FromJSON (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods parseJSON :: Value -> Parser (BackendKey (Compatible b s)) # parseJSONList :: Value -> Parser [BackendKey (Compatible b s)] # omittedField :: Maybe (BackendKey (Compatible b s)) #
FromJSON (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseJSON :: Value -> Parser (BackendKey SqlBackend) # parseJSONList :: Value -> Parser [BackendKey SqlBackend] # omittedField :: Maybe (BackendKey SqlBackend) #
(BackendCompatible b s, ToJSON (BackendKey b)) => ToJSON (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods toJSON :: BackendKey (Compatible b s) -> Value # toEncoding :: BackendKey (Compatible b s) -> Encoding # toJSONList :: [BackendKey (Compatible b s)] -> Value # toEncodingList :: [BackendKey (Compatible b s)] -> Encoding # omitField :: BackendKey (Compatible b s) -> Bool #
ToJSON (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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 #
(BackendCompatible b s, Bounded (BackendKey b)) => Bounded (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods minBound :: BackendKey (Compatible b s) # maxBound :: BackendKey (Compatible b s) #
Bounded (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods minBound :: BackendKey SqlReadBackend # maxBound :: BackendKey SqlReadBackend #
Bounded (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods minBound :: BackendKey SqlWriteBackend # maxBound :: BackendKey SqlWriteBackend #
Bounded (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods minBound :: BackendKey SqlBackend # maxBound :: BackendKey SqlBackend #
(BackendCompatible b s, Enum (BackendKey b)) => Enum (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods succ :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) # pred :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) # toEnum :: Int -> BackendKey (Compatible b s) # fromEnum :: BackendKey (Compatible b s) -> Int # enumFrom :: BackendKey (Compatible b s) -> [BackendKey (Compatible b s)] # enumFromThen :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> [BackendKey (Compatible b s)] # enumFromTo :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> [BackendKey (Compatible b s)] # enumFromThenTo :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> [BackendKey (Compatible b s)] #
Enum (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
type Rep (BackendKey SqlReadBackend) |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlReadBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlReadBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlReadBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
Methods from :: BackendKey SqlReadBackend -> Rep (BackendKey SqlReadBackend) x # to :: Rep (BackendKey SqlReadBackend) x -> BackendKey SqlReadBackend #
Generic (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
type Rep (BackendKey SqlWriteBackend) |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlWriteBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlWriteBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlWriteBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
Methods from :: BackendKey SqlWriteBackend -> Rep (BackendKey SqlWriteBackend) x # to :: Rep (BackendKey SqlWriteBackend) x -> BackendKey SqlWriteBackend #
Generic (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
type Rep (BackendKey SqlBackend) |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
Methods from :: BackendKey SqlBackend -> Rep (BackendKey SqlBackend) x # to :: Rep (BackendKey SqlBackend) x -> BackendKey SqlBackend #
(BackendCompatible b s, Num (BackendKey b)) => Num (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods (+) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # (-) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # (*) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # negate :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) # abs :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) # signum :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) # fromInteger :: Integer -> BackendKey (Compatible b s) #
Num (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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 #
(BackendCompatible b s, Read (BackendKey b)) => Read (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods readsPrec :: Int -> ReadS (BackendKey (Compatible b s)) # readList :: ReadS [BackendKey (Compatible b s)] # readPrec :: ReadPrec (BackendKey (Compatible b s)) # readListPrec :: ReadPrec [BackendKey (Compatible b s)] #
Read (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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] #
(BackendCompatible b s, Integral (BackendKey b)) => Integral (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods quot :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # rem :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # div :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # mod :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # quotRem :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> (BackendKey (Compatible b s), BackendKey (Compatible b s)) # divMod :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> (BackendKey (Compatible b s), BackendKey (Compatible b s)) # toInteger :: BackendKey (Compatible b s) -> Integer #
Integral (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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 #
(BackendCompatible b s, Real (BackendKey b)) => Real (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods toRational :: BackendKey (Compatible b s) -> Rational #
Real (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlReadBackend -> Rational #
Real (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlWriteBackend -> Rational #
Real (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlBackend -> Rational #
(BackendCompatible b s, Show (BackendKey b)) => Show (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods showsPrec :: Int -> BackendKey (Compatible b s) -> ShowS # show :: BackendKey (Compatible b s) -> String # showList :: [BackendKey (Compatible b s)] -> ShowS #
Show (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlReadBackend -> ShowS # show :: BackendKey SqlReadBackend -> String # showList :: [BackendKey SqlReadBackend] -> ShowS #
Show (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlWriteBackend -> ShowS # show :: BackendKey SqlWriteBackend -> String # showList :: [BackendKey SqlWriteBackend] -> ShowS #
Show (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlBackend -> ShowS # show :: BackendKey SqlBackend -> String # showList :: [BackendKey SqlBackend] -> ShowS #
(BackendCompatible b s, Eq (BackendKey b)) => Eq (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods (==) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool # (/=) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool #
Eq (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool # (/=) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool #
Eq (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool # (/=) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool #
Eq (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool # (/=) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool #
(BackendCompatible b s, Ord (BackendKey b)) => Ord (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods compare :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Ordering # (<) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool # (<=) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool # (>) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool # (>=) :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> Bool # max :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) # min :: BackendKey (Compatible b s) -> BackendKey (Compatible b s) -> BackendKey (Compatible b s) #
Ord (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlReadBackend) # toPathPiece :: BackendKey SqlReadBackend -> Text #
PathPiece (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlWriteBackend) # toPathPiece :: BackendKey SqlWriteBackend -> Text #
PathPiece (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlBackend) # toPathPiece :: BackendKey SqlBackend -> Text #
(BackendCompatible b s, PersistField (BackendKey b)) => PersistField (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods toPersistValue :: BackendKey (Compatible b s) -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey (Compatible b s)) #
PersistField (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlReadBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlReadBackend) #
PersistField (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlWriteBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlWriteBackend) #
PersistField (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlBackend) #
(BackendCompatible b s, PersistFieldSql (BackendKey b)) => PersistFieldSql (BackendKey (Compatible b s)) # |
Instance details Defined in Database.Persist.Compatible.Types Methods sqlType :: Proxy (BackendKey (Compatible b s)) -> SqlType #
PersistFieldSql (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlReadBackend) -> SqlType #
PersistFieldSql (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlWriteBackend) -> SqlType #
PersistFieldSql (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlBackend) -> SqlType #
newtype BackendKey SqlReadBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlReadBackend = SqlReadBackendKey { unSqlReadBackendKey :: Int64 }
newtype BackendKey SqlWriteBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlWriteBackend = SqlWriteBackendKey { unSqlWriteBackendKey :: Int64 }
newtype BackendKey SqlBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlBackend = SqlBackendKey { unSqlBackendKey :: Int64 }
type Rep (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlReadBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlReadBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlReadBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
type Rep (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlWriteBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlWriteBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlWriteBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
type Rep (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
newtype BackendKey (Compatible b s) # |
Instance details Defined in Database.Persist.Compatible.Types newtype BackendKey (Compatible b s) = CompatibleKey { unCompatibleKey :: BackendKey b }

withRawQuery :: forall (m :: Type -> Type) a. MonadIO m => Text -> [PersistValue] -> ConduitM [PersistValue] Void IO a -> ReaderT SqlBackend m a #

toSqlKey :: ToBackendKey SqlBackend record => Int64 -> Key record #

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 #

get the SQL string for the field that an EntityField represents Useful for raw SQL queries

Your backend may provide a more convenient fieldName function which does not operate in a Monad

getTableName :: forall record (m :: Type -> Type) backend. (PersistEntity record, BackendCompatible SqlBackend backend, Monad m) => record -> ReaderT backend m Text #

get the SQL string for the table that a PersistEntity represents Useful for raw SQL queries

Your backend may provide a more convenient tableName function which does not operate in a Monad

tableDBName :: PersistEntity record => record -> EntityNameDB #

useful for a backend to implement tableName by adding escaping

fieldDBName :: PersistEntity record => EntityField record typ -> FieldNameDB #

useful for a backend to implement fieldName by adding escaping

# The Escape Hatch

`persistent` offers a set of functions that are useful for operating directly on the underlying SQL database. This can allow you to use whatever SQL features you want.

Consider going to <https://hackage.haskell.org/package/esqueleto esqueleto> for a more powerful SQL query library built on `persistent`.

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 ())) #

rawExecute #

Arguments

:: forall (m :: Type -> Type) backend. (MonadIO m, BackendCompatible SqlBackend backend) |
=> Text | SQL statement, possibly with placeholders.
-> [PersistValue] | Values to fill the placeholders.
-> ReaderT backend m () |

Execute a raw SQL statement

rawExecuteCount #

Arguments

:: forall (m :: Type -> Type) backend. (MonadIO m, BackendCompatible SqlBackend backend) |
=> Text | SQL statement, possibly with placeholders.
-> [PersistValue] | Values to fill the placeholders.
-> ReaderT backend m Int64 |

Execute a raw SQL statement and return the number of rows it has modified.

rawSql #

Arguments

:: forall a (m :: Type -> Type) backend. (RawSql a, MonadIO m, BackendCompatible SqlBackend backend) |
=> Text | SQL statement, possibly with placeholders.
-> [PersistValue] | Values to fill the placeholders.
-> ReaderT backend m [a] |

Execute a raw SQL statement and return its results as a list. If you do not expect a return value, use of `rawExecute` is recommended.

If you're using `Entity` `s` (which is quite likely), then you must use entity selection placeholders (double question mark, `??`). These `??` placeholders are then replaced for the names of the columns that we need for your entities. You'll receive an error if you don't use the placeholders. Please see the `Entity` `s` documentation for more details.

You may put value placeholders (question marks, `?`) in your SQL query. These placeholders are then replaced by the values you pass on the second parameter, already correctly escaped. You may want to use `toPersistValue` to help you constructing the placeholder values.

Since you're giving a raw SQL statement, you don't get any guarantees regarding safety. If `rawSql` is not able to parse the results of your query back, then an exception is raised. However, most common problems are mitigated by using the entity selection placeholder `??`, and you shouldn't see any error at all if you're not using `Single`.

Some example of `rawSql` based on this schema:

    share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
    Person
        name String
        age Int Maybe
        deriving Show
    BlogPost
        title String
        authorId PersonId
        deriving Show
    |]

Examples based on the above schema:

    getPerson :: MonadIO m => ReaderT SqlBackend m [Entity Person]
    getPerson = rawSql "select ?? from person where name=?" [PersistText "john"]

    getAge :: MonadIO m => ReaderT SqlBackend m [Single Int]
    getAge = rawSql "select person.age from person where name=?" [PersistText "john"]

    getAgeName :: MonadIO m => ReaderT SqlBackend m [(Single Int, Single Text)]
    getAgeName = rawSql "select person.age, person.name from person where name=?" [PersistText "john"]

    getPersonBlog :: MonadIO m => ReaderT SqlBackend m [(Entity Person, Entity BlogPost)]
    getPersonBlog = rawSql "select ??,?? from person,blog_post where person.id = blog_post.author_id" []

Minimal working program for PostgreSQL backend based on the above concepts:

    {-# LANGUAGE EmptyDataDecls             #-}
    {-# LANGUAGE FlexibleContexts           #-}
    {-# LANGUAGE GADTs                      #-}
    {-# LANGUAGE GeneralizedNewtypeDeriving #-}
    {-# LANGUAGE MultiParamTypeClasses      #-}
    {-# LANGUAGE OverloadedStrings          #-}
    {-# LANGUAGE QuasiQuotes                #-}
    {-# LANGUAGE TemplateHaskell            #-}
    {-# LANGUAGE TypeFamilies               #-}

    import           Control.Monad.IO.Class  (liftIO)
    import           Control.Monad.Logger    (runStderrLoggingT)
    import           Database.Persist
    import           Control.Monad.Reader
    import           Data.Text
    import           Database.Persist.Sql
    import           Database.Persist.Postgresql
    import           Database.Persist.TH

    share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
    Person
        name String
        age Int Maybe
        deriving Show
    |]

    conn = "host=localhost dbname=new_db user=postgres password=postgres port=5432"

    getPerson :: MonadIO m => ReaderT SqlBackend m [Entity Person]
    getPerson = rawSql "select ?? from person where name=?" [PersistText "sibi"]

    liftSqlPersistMPool y x = liftIO (runSqlPersistMPool y x)

    main :: IO ()
    main = runStderrLoggingT $ withPostgresqlPool conn 10 $ liftSqlPersistMPool $ do
             runMigration migrateAll
             xs <- getPerson
             liftIO (print xs)

# SQL helpers

deleteWhereCount :: forall val (m :: Type -> Type) backend. (PersistEntity val, MonadIO m, PersistEntityBackend val ~ SqlBackend, BackendCompatible SqlBackend backend) => [Filter val] -> ReaderT backend m Int64 #

Same as `deleteWhere`, but returns the number of rows affected.

Since: 1.1.5

updateWhereCount :: forall val (m :: Type -> Type) backend. (PersistEntity val, MonadIO m, SqlBackend ~ PersistEntityBackend val, BackendCompatible SqlBackend backend) => [Filter val] -> [Update val] -> ReaderT backend m Int64 #

Same as `updateWhere`, but returns the number of rows affected.

Since: 1.1.5

filterClause #

Arguments

:: PersistEntity val |
=> Maybe FilterTablePrefix | include table name or EXCLUDED
-> SqlBackend |
-> [Filter val] |
-> Text |

Render a `[`Filter` record]` into a `Text` value suitable for inclusion into a SQL query.

Since: 2.12.1.0

filterClauseWithVals #

Arguments

:: PersistEntity val |
=> Maybe FilterTablePrefix | include table name or EXCLUDED
-> SqlBackend |
-> [Filter val] |
-> (Text, [PersistValue]) |

Render a `[`Filter` record]` into a `Text` value suitable for inclusion into a SQL query, as well as the `[`PersistValue`]` to properly fill in the `?` place holders.

Since: 2.12.1.0

orderClause #

Arguments

:: PersistEntity val |
=> Maybe FilterTablePrefix | include table name or EXCLUDED
-> SqlBackend |
-> [SelectOpt val] |
-> Text |

Render a `[`SelectOpt` record]` made up *only* of `Asc` and `Desc` constructors into a `Text` value suitable for inclusion into a SQL query.

Since: 2.13.2.0

data FilterTablePrefix #

Used when determining how to prefix a column name in a `WHERE` clause.

Since: 2.12.1.0

Constructors

PrefixTableName | Prefix the column with the table name. This is useful if the column name might be ambiguous. Since: 2.12.1.0
PrefixExcluded | Prefix the column name with the `EXCLUDED` keyword. This is used with the Postgresql backend when doing `ON CONFLICT DO UPDATE` clauses - see the documentation on `upsertWhere` and `upsertManyWhere`. Since: 2.12.1.0

# Transactions

transactionSave :: forall (m :: Type -> Type). MonadIO m => ReaderT SqlBackend m () #

Commit the current transaction and begin a new one. This is used when a transaction commit is required within the context of `runSqlConn` (which brackets its provided action with a transaction begin/commit pair).

Since: 1.2.0

transactionSaveWithIsolation :: forall (m :: Type -> Type). MonadIO m => IsolationLevel -> ReaderT SqlBackend m () #

Commit the current transaction and begin a new one with the specified isolation level.

Since: 2.9.0

transactionUndo :: forall (m :: Type -> Type). MonadIO m => ReaderT SqlBackend m () #

Roll back the current transaction and begin a new one. This rolls back to the state of the last call to `transactionSave` or the enclosing `runSqlConn` call.

Since: 1.2.0

transactionUndoWithIsolation :: forall (m :: Type -> Type). MonadIO m => IsolationLevel -> ReaderT SqlBackend m () #

Roll back the current transaction and begin a new one with the specified isolation level.

Since: 2.9.0

# Other utilities

getStmtConn :: SqlBackend -> Text -> IO Statement #

mkColumns :: [EntityDef] -> EntityDef -> BackendSpecificOverrides -> ([Column], [UniqueDef], [ForeignDef]) #

Create the list of columns for the given entity.

data BackendSpecificOverrides #

Record of functions to override the default behavior in `mkColumns`. It is recommended you initialize this with `emptyBackendSpecificOverrides` and override the default values, so that as new fields are added, your code still compiles.

For added safety, use the `getBackendSpecific*` and `setBackendSpecific*` functions, as a breaking change to the record field labels won't be reflected in a major version bump of the library.

Since: 2.11

emptyBackendSpecificOverrides :: BackendSpecificOverrides #

Creates an empty `BackendSpecificOverrides` (i.e. use the default behavior; no overrides)

Since: 2.11

getBackendSpecificForeignKeyName :: BackendSpecificOverrides -> Maybe (EntityNameDB -> FieldNameDB -> ConstraintNameDB) #

If the override is defined, then this returns a function that accepts an entity name and field name and provides the `ConstraintNameDB` for the foreign key constraint.

An abstract accessor for the `BackendSpecificOverrides`

Since: 2.13.0.0

setBackendSpecificForeignKeyName :: (EntityNameDB -> FieldNameDB -> ConstraintNameDB) -> BackendSpecificOverrides -> BackendSpecificOverrides #

Set the backend's foreign key generation function to this value.

Since: 2.13.0.0

defaultAttribute :: [FieldAttr] -> Maybe Text #

# Internal

data IsolationLevel #

Please refer to the documentation for the database in question for a full overview of the semantics of the varying isloation levels

Constructors

ReadUncommitted |
ReadCommitted |
RepeatableRead |
Serializable |

#### Instances

Instances details

Bounded IsolationLevel # |
Instance details Defined in Database.Persist.SqlBackend.Internal.IsolationLevel Methods minBound :: IsolationLevel # maxBound :: IsolationLevel #
Enum IsolationLevel # |
Instance details 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 # |
Instance details Defined in Database.Persist.SqlBackend.Internal.IsolationLevel Methods showsPrec :: Int -> IsolationLevel -> ShowS # show :: IsolationLevel -> String # showList :: [IsolationLevel] -> ShowS #
Eq IsolationLevel # |
Instance details Defined in Database.Persist.SqlBackend.Internal.IsolationLevel Methods (==) :: IsolationLevel -> IsolationLevel -> Bool # (/=) :: IsolationLevel -> IsolationLevel -> Bool #
Ord IsolationLevel # |
Instance details 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 #

decorateSQLWithLimitOffset :: Text -> (Int, Int) -> Text -> Text #

Generates sql for limit and offset for postgres, sqlite and mysql.

newtype Single a #

A single column (see `rawSql`). Any `PersistField` may be used here, including `PersistValue` (which does not do any processing).

Constructors

Single |
Fields unSingle :: a

#### Instances

Instances details

Read a => Read (Single a) # |
Instance details Defined in Database.Persist.Sql.Types Methods readsPrec :: Int -> ReadS (Single a) # readList :: ReadS [Single a] # readPrec :: ReadPrec (Single a) # readListPrec :: ReadPrec [Single a] #
Show a => Show (Single a) # |
Instance details Defined in Database.Persist.Sql.Types Methods showsPrec :: Int -> Single a -> ShowS # show :: Single a -> String # showList :: [Single a] -> ShowS #
Eq a => Eq (Single a) # |
Instance details Defined in Database.Persist.Sql.Types Methods (==) :: Single a -> Single a -> Bool # (/=) :: Single a -> Single a -> Bool #
Ord a => Ord (Single a) # |
Instance details Defined in Database.Persist.Sql.Types Methods compare :: Single a -> Single a -> Ordering # (<) :: Single a -> Single a -> Bool # (<=) :: Single a -> Single a -> Bool # (>) :: Single a -> Single a -> Bool # (>=) :: Single a -> Single a -> Bool # max :: Single a -> Single a -> Single a # min :: Single a -> Single a -> Single a #
PersistField a => RawSql (Single a) # |
Instance details Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> Single a -> (Int, [Text]) # rawSqlColCountReason :: Single a -> String # rawSqlProcessRow :: [PersistValue] -> Either Text (Single a) #

data Column #

Constructors

Column |
Fields cName :: !FieldNameDB cNull :: !Bool cSqlType :: !SqlType cDefault :: !(Maybe Text) cGenerated :: !(Maybe Text) cDefaultConstraintName :: !(Maybe ConstraintNameDB) cMaxLen :: !(Maybe Integer) cReference :: !(Maybe ColumnReference)

#### Instances

Instances details

Show Column # |
Instance details Defined in Database.Persist.Sql.Types Methods showsPrec :: Int -> Column -> ShowS # show :: Column -> String # showList :: [Column] -> ShowS #
Eq Column # |
Instance details Defined in Database.Persist.Sql.Types Methods (==) :: Column -> Column -> Bool # (/=) :: Column -> Column -> Bool #
Ord Column # |
Instance details Defined in Database.Persist.Sql.Types Methods compare :: Column -> Column -> Ordering # (<) :: Column -> Column -> Bool # (<=) :: Column -> Column -> Bool # (>) :: Column -> Column -> Bool # (>=) :: Column -> Column -> Bool # max :: Column -> Column -> Column # min :: Column -> Column -> Column #

newtype OverflowNatural #

Prior to `persistent-2.11.0`, we provided an instance of `PersistField` for the `Natural` type. This was in error, because `Natural` represents an infinite value, and databases don't have reasonable types for this.

The instance for `Natural` used the `Int64` underlying type, which will cause underflow and overflow errors. This type has the exact same code in the instances, and will work seamlessly.

A more appropriate type for this is the `Word` series of types from Data.Word. These have a bounded size, are guaranteed to be non-negative, and are quite efficient for the database to store.

Since: 2.11.0

Constructors

OverflowNatural |
Fields unOverflowNatural :: Natural

#### Instances

Instances details

Num OverflowNatural # |
Instance details 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 # |
Instance details Defined in Database.Persist.Class.PersistField Methods showsPrec :: Int -> OverflowNatural -> ShowS # show :: OverflowNatural -> String # showList :: [OverflowNatural] -> ShowS #
Eq OverflowNatural # |
Instance details Defined in Database.Persist.Class.PersistField Methods (==) :: OverflowNatural -> OverflowNatural -> Bool # (/=) :: OverflowNatural -> OverflowNatural -> Bool #
Ord OverflowNatural # |
Instance details 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 # |
Instance details Defined in Database.Persist.Class.PersistField Methods toPersistValue :: OverflowNatural -> PersistValue # fromPersistValue :: PersistValue -> Either Text OverflowNatural #
PersistFieldSql OverflowNatural # | This type uses the `SqlInt64` version, which will exhibit overflow and underflow behavior. Additionally, it permits negative values in the database, which isn't ideal. Since: 2.11.0
Instance details Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy OverflowNatural -> SqlType #

data SqlBackend #

A `SqlBackend` represents a handle or connection to a database. It contains functions and values that allow databases to have more optimized implementations, as well as references that benefit performance and sharing.

Instead of using the `SqlBackend` constructor directly, use the `mkSqlBackend` function.

A `SqlBackend` is *not* thread-safe. You should not assume that a `SqlBackend` can be shared among threads and run concurrent queries. This *will* result in problems. Instead, you should create a ``Pool` `SqlBackend``, known as a `ConnectionPool`, and pass that around in multi-threaded applications.

To run actions in the `persistent` library, you should use the `runSqlConn` function. If you're using a multithreaded application, use the `runSqlPool` function.

#### Instances

Instances details

PersistQueryRead SqlBackend # |
Instance details 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 #
PersistQueryWrite SqlBackend # |
Instance details 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 () #
HasPersistBackend SqlBackend # |
Instance details Defined in Database.Persist.SqlBackend.Internal Associated Types
type BaseBackend SqlBackend |
Instance details Defined in Database.Persist.SqlBackend.Internal type BaseBackend SqlBackend = SqlBackend
Methods persistBackend :: SqlBackend -> BaseBackend SqlBackend #
IsPersistBackend SqlBackend # |
Instance details Defined in Database.Persist.SqlBackend.Internal Methods mkPersistBackend :: BaseBackend SqlBackend -> SqlBackend #
PersistCore SqlBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
newtype BackendKey SqlBackend |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlBackend = SqlBackendKey { unSqlBackendKey :: Int64 }
PersistStoreRead SqlBackend # |
Instance details 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) #
PersistStoreWrite SqlBackend # |
Instance details 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 #
PersistUniqueRead SqlBackend # |
Instance details 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 #
PersistUniqueWrite SqlBackend # |
Instance details 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 () #
BackendCompatible SqlBackend SqlReadBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods projectBackend :: SqlReadBackend -> SqlBackend #
BackendCompatible SqlBackend SqlWriteBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods projectBackend :: SqlWriteBackend -> SqlBackend #
BackendCompatible SqlBackend SqlBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods projectBackend :: SqlBackend -> SqlBackend #
FromJSON (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods parseJSON :: Value -> Parser (BackendKey SqlBackend) # parseJSONList :: Value -> Parser [BackendKey SqlBackend] # omittedField :: Maybe (BackendKey SqlBackend) #
ToJSON (BackendKey SqlBackend) # |
Instance details 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 SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods minBound :: BackendKey SqlBackend # maxBound :: BackendKey SqlBackend #
Enum (BackendKey SqlBackend) # |
Instance details 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 SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
type Rep (BackendKey SqlBackend) |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
Methods from :: BackendKey SqlBackend -> Rep (BackendKey SqlBackend) x # to :: Rep (BackendKey SqlBackend) x -> BackendKey SqlBackend #
Num (BackendKey SqlBackend) # |
Instance details 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 SqlBackend) # |
Instance details 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 SqlBackend) # |
Instance details 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 SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlBackend -> Rational #
Show (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlBackend -> ShowS # show :: BackendKey SqlBackend -> String # showList :: [BackendKey SqlBackend] -> ShowS #
Eq (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool # (/=) :: BackendKey SqlBackend -> BackendKey SqlBackend -> Bool #
Ord (BackendKey SqlBackend) # |
Instance details 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 SqlBackend) # |
Instance details 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 SqlBackend) # |
Instance details 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 SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlBackend) # toPathPiece :: BackendKey SqlBackend -> Text #
PersistField (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlBackend) #
PersistFieldSql (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlBackend) -> SqlType #
newtype BackendKey SqlBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlBackend = SqlBackendKey { unSqlBackendKey :: Int64 }
type BaseBackend SqlBackend # |
Instance details Defined in Database.Persist.SqlBackend.Internal type BaseBackend SqlBackend = SqlBackend
type Rep (BackendKey SqlBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype SqlReadBackend #

An SQL backend which can only handle read queries

The constructor was exposed in 2.10.0.

Constructors

SqlReadBackend |
Fields unSqlReadBackend :: SqlBackend

#### Instances

Instances details

PersistQueryRead SqlReadBackend # |
Instance details 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 # |
Instance details Defined in Database.Persist.Sql.Types.Internal Associated Types
type BaseBackend SqlReadBackend |
Instance details Defined in Database.Persist.Sql.Types.Internal type BaseBackend SqlReadBackend = SqlBackend
Methods persistBackend :: SqlReadBackend -> BaseBackend SqlReadBackend #
IsPersistBackend SqlReadBackend # |
Instance details Defined in Database.Persist.Sql.Types.Internal Methods mkPersistBackend :: BaseBackend SqlReadBackend -> SqlReadBackend #
PersistCore SqlReadBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
newtype BackendKey SqlReadBackend |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlReadBackend = SqlReadBackendKey { unSqlReadBackendKey :: Int64 }
PersistStoreRead SqlReadBackend # |
Instance details 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 # |
Instance details 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 # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods projectBackend :: SqlReadBackend -> SqlBackend #
FromJSON (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods minBound :: BackendKey SqlReadBackend # maxBound :: BackendKey SqlReadBackend #
Enum (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
type Rep (BackendKey SqlReadBackend) |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlReadBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlReadBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlReadBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
Methods from :: BackendKey SqlReadBackend -> Rep (BackendKey SqlReadBackend) x # to :: Rep (BackendKey SqlReadBackend) x -> BackendKey SqlReadBackend #
Num (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlReadBackend -> Rational #
Show (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlReadBackend -> ShowS # show :: BackendKey SqlReadBackend -> String # showList :: [BackendKey SqlReadBackend] -> ShowS #
Eq (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool # (/=) :: BackendKey SqlReadBackend -> BackendKey SqlReadBackend -> Bool #
Ord (BackendKey SqlReadBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlReadBackend) # toPathPiece :: BackendKey SqlReadBackend -> Text #
PersistField (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlReadBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlReadBackend) #
PersistFieldSql (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlReadBackend) -> SqlType #
newtype BackendKey SqlReadBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlReadBackend = SqlReadBackendKey { unSqlReadBackendKey :: Int64 }
type BaseBackend SqlReadBackend # |
Instance details Defined in Database.Persist.Sql.Types.Internal type BaseBackend SqlReadBackend = SqlBackend
type Rep (BackendKey SqlReadBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlReadBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlReadBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlReadBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype SqlWriteBackend #

An SQL backend which can handle read or write queries

The constructor was exposed in 2.10.0

Constructors

SqlWriteBackend |
Fields unSqlWriteBackend :: SqlBackend

#### Instances

Instances details

PersistQueryRead SqlWriteBackend # |
Instance details 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 # |
Instance details 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 # |
Instance details Defined in Database.Persist.Sql.Types.Internal Associated Types
type BaseBackend SqlWriteBackend |
Instance details Defined in Database.Persist.Sql.Types.Internal type BaseBackend SqlWriteBackend = SqlBackend
Methods persistBackend :: SqlWriteBackend -> BaseBackend SqlWriteBackend #
IsPersistBackend SqlWriteBackend # |
Instance details Defined in Database.Persist.Sql.Types.Internal Methods mkPersistBackend :: BaseBackend SqlWriteBackend -> SqlWriteBackend #
PersistCore SqlWriteBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
newtype BackendKey SqlWriteBackend |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlWriteBackend = SqlWriteBackendKey { unSqlWriteBackendKey :: Int64 }
PersistStoreRead SqlWriteBackend # |
Instance details 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 # |
Instance details 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 # |
Instance details 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 # |
Instance details 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 # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods projectBackend :: SqlWriteBackend -> SqlBackend #
FromJSON (BackendKey SqlWriteBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods minBound :: BackendKey SqlWriteBackend # maxBound :: BackendKey SqlWriteBackend #
Enum (BackendKey SqlWriteBackend) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Associated Types
type Rep (BackendKey SqlWriteBackend) |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlWriteBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlWriteBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlWriteBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
Methods from :: BackendKey SqlWriteBackend -> Rep (BackendKey SqlWriteBackend) x # to :: Rep (BackendKey SqlWriteBackend) x -> BackendKey SqlWriteBackend #
Num (BackendKey SqlWriteBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toRational :: BackendKey SqlWriteBackend -> Rational #
Show (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods showsPrec :: Int -> BackendKey SqlWriteBackend -> ShowS # show :: BackendKey SqlWriteBackend -> String # showList :: [BackendKey SqlWriteBackend] -> ShowS #
Eq (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods (==) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool # (/=) :: BackendKey SqlWriteBackend -> BackendKey SqlWriteBackend -> Bool #
Ord (BackendKey SqlWriteBackend) # |
Instance details 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) # |
Instance details 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) # |
Instance details 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) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods fromPathPiece :: Text -> Maybe (BackendKey SqlWriteBackend) # toPathPiece :: BackendKey SqlWriteBackend -> Text #
PersistField (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods toPersistValue :: BackendKey SqlWriteBackend -> PersistValue # fromPersistValue :: PersistValue -> Either Text (BackendKey SqlWriteBackend) #
PersistFieldSql (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore Methods sqlType :: Proxy (BackendKey SqlWriteBackend) -> SqlType #
newtype BackendKey SqlWriteBackend # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore newtype BackendKey SqlWriteBackend = SqlWriteBackendKey { unSqlWriteBackendKey :: Int64 }
type BaseBackend SqlWriteBackend # |
Instance details Defined in Database.Persist.Sql.Types.Internal type BaseBackend SqlWriteBackend = SqlBackend
type Rep (BackendKey SqlWriteBackend) # |
Instance details Defined in Database.Persist.Sql.Orphan.PersistStore type Rep (BackendKey SqlWriteBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.6.3-JVVGzpBhz0IC64DMc3fyym" 'True) (C1 ('MetaCons "SqlWriteBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlWriteBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

readToUnknown :: forall (m :: Type -> Type) a. Monad m => ReaderT SqlReadBackend m a -> ReaderT SqlBackend m a #

Useful for running a read query against a backend with unknown capabilities.

readToWrite :: forall (m :: Type -> Type) a. Monad m => ReaderT SqlReadBackend m a -> ReaderT SqlWriteBackend m a #

Useful for running a read query against a backend with read and write capabilities.

writeToUnknown :: forall (m :: Type -> Type) a. Monad m => ReaderT SqlWriteBackend m a -> ReaderT SqlBackend m a #

Useful for running a write query against an untagged backend with unknown capabilities.

type LogFunc = Loc -> LogSource -> LogLevel -> LogStr -> IO () #

data InsertSqlResult #

Constructors

ISRSingle Text |
ISRInsertGet Text Text |
ISRManyKeys Text [PersistValue] |

data Statement #

A `Statement` is a representation of a database query that has been prepared and stored on the server side.

Constructors

Statement |
Fields stmtFinalize :: IO () stmtReset :: IO () stmtExecute :: [PersistValue] -> IO Int64 stmtQuery :: forall (m :: Type -> Type). MonadIO m => [PersistValue] -> Acquire (ConduitM () [PersistValue] m ())

type SqlBackendCanRead backend = (BackendCompatible SqlBackend backend, PersistQueryRead backend, PersistStoreRead backend, PersistUniqueRead backend) #

A constraint synonym which witnesses that a backend is SQL and can run read queries.

type SqlBackendCanWrite backend = (SqlBackendCanRead backend, PersistQueryWrite backend, PersistStoreWrite backend, PersistUniqueWrite backend) #

A constraint synonym which witnesses that a backend is SQL and can run read and write queries.

type SqlReadT (m :: Type -> Type) a = forall backend. SqlBackendCanRead backend => ReaderT backend m a #

Like `SqlPersistT` but compatible with any SQL backend which can handle read queries.

type SqlWriteT (m :: Type -> Type) a = forall backend. SqlBackendCanWrite backend => ReaderT backend m a #

Like `SqlPersistT` but compatible with any SQL backend which can handle read and write queries.

type IsSqlBackend backend = (IsPersistBackend backend, BaseBackend backend ~ SqlBackend) #

A backend which is a wrapper around `SqlBackend`.

data ConnectionPoolConfig #

Values to configure a pool of database connections. See Data.Pool for details.

Since: 2.11.0.0

Constructors

ConnectionPoolConfig |
Fields connectionPoolConfigStripes :: Int How many stripes to divide the pool into. See Data.Pool for details. Default: 1. connectionPoolConfigIdleTimeout :: NominalDiffTime How long connections can remain idle before being disposed of, in seconds. Default: 600 connectionPoolConfigSize :: Int How many connections should be held in the connection pool. Default: 10

#### Instances

Instances details

Show ConnectionPoolConfig # |
Instance details Defined in Database.Persist.Sql.Types Methods showsPrec :: Int -> ConnectionPoolConfig -> ShowS # show :: ConnectionPoolConfig -> String # showList :: [ConnectionPoolConfig] -> ShowS #

type ConnectionPool = Pool SqlBackend #

type SqlPersistT = ReaderT SqlBackend #

data ColumnReference #

This value specifies how a field references another table.

Since: 2.11.0.0

Constructors

ColumnReference |
Fields crTableName :: !EntityNameDB The table name that the Since: 2.11.0.0 crConstraintName :: !ConstraintNameDB The name of the foreign key constraint. Since: 2.11.0.0 crFieldCascade :: !FieldCascade Whether or not updates/deletions to the referenced table cascade to this table. Since: 2.11.0.0

#### Instances

Instances details

Show ColumnReference # |
Instance details Defined in Database.Persist.Sql.Types Methods showsPrec :: Int -> ColumnReference -> ShowS # show :: ColumnReference -> String # showList :: [ColumnReference] -> ShowS #
Eq ColumnReference # |
Instance details Defined in Database.Persist.Sql.Types Methods (==) :: ColumnReference -> ColumnReference -> Bool # (/=) :: ColumnReference -> ColumnReference -> Bool #
Ord ColumnReference # |
Instance details 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 #

data PersistentSqlException #

Constructors

StatementAlreadyFinalized Text |
Couldn'tGetSQLConnection |

#### Instances

Instances details

Exception PersistentSqlException # |
Instance details Defined in Database.Persist.Sql.Types Methods toException :: PersistentSqlException -> SomeException # fromException :: SomeException -> Maybe PersistentSqlException # displayException :: PersistentSqlException -> String # backtraceDesired :: PersistentSqlException -> Bool #
Show PersistentSqlException # |
Instance details Defined in Database.Persist.Sql.Types Methods showsPrec :: Int -> PersistentSqlException -> ShowS # show :: PersistentSqlException -> String # showList :: [PersistentSqlException] -> ShowS #

type SqlPersistM = SqlPersistT (NoLoggingT (ResourceT IO)) #

defaultConnectionPoolConfig :: ConnectionPoolConfig #

Initializes a ConnectionPoolConfig with default values. See the documentation of `ConnectionPoolConfig` for each field's default value.

Since: 2.11.0.0