btc-lsp-0.1.0.0: Lightning service provider
Safe HaskellSafe-Inferred
LanguageHaskell2010

BtcLsp.Import.Psql

Synopsis

Documentation

data LiteralType #

A type that determines how a backend should handle the literal.

Since: persistent-2.12.0.0

Constructors

Escaped

The accompanying value will be escaped before inserting into the database. This is the correct default choice to use.

Since: persistent-2.12.0.0

Unescaped

The accompanying value will not be escaped when inserting into the database. This is potentially dangerous - use this with care.

Since: persistent-2.12.0.0

DbSpecific

The DbSpecific constructor corresponds to the legacy PersistDbSpecific constructor. We need to keep this around because old databases may have serialized JSON representations that reference this. We don't want to break the ability of a database to load rows.

Since: persistent-2.12.0.0

Instances

Instances details
Read LiteralType 
Instance details

Defined in Database.Persist.PersistValue

Show LiteralType 
Instance details

Defined in Database.Persist.PersistValue

Eq LiteralType 
Instance details

Defined in Database.Persist.PersistValue

Ord LiteralType 
Instance details

Defined in Database.Persist.PersistValue

type Rep LiteralType 
Instance details

Defined in Text.PrettyPrint.GenericPretty.Instance

type Rep LiteralType = D1 ('MetaData "LiteralType" "Database.Persist.PersistValue" "persistent-2.13.3.4-K7QWPYwATzA73w61MYpbGo" 'False) (C1 ('MetaCons "Escaped" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Unescaped" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DbSpecific" 'PrefixI 'False) (U1 :: Type -> Type)))

data PersistValue #

A raw value which can be stored in any backend and can be marshalled to and from a PersistField.

Constructors

PersistText Text 
PersistByteString ByteString 
PersistInt64 Int64 
PersistDouble Double 
PersistRational Rational 
PersistBool Bool 
PersistDay Day 
PersistTimeOfDay TimeOfDay 
PersistUTCTime UTCTime 
PersistNull 
PersistList [PersistValue] 
PersistMap [(Text, PersistValue)] 
PersistObjectId ByteString

Intended especially for MongoDB backend

PersistArray [PersistValue]

Intended especially for PostgreSQL backend for text arrays

PersistLiteral_ LiteralType ByteString

This constructor is used to specify some raw literal value for the backend. The LiteralType value specifies how the value should be escaped. This can be used to make special, custom types avaialable in the back end.

Since: persistent-2.12.0.0

Bundled Patterns

pattern PersistLiteral :: ByteString -> PersistValue

This pattern synonym used to be a data constructor on PersistValue, but was changed into a catch-all pattern synonym to allow backwards compatiblity with database types. See the documentation on PersistDbSpecific for more details.

Since: persistent-2.12.0.0

pattern PersistDbSpecific :: ByteString -> PersistValue

This pattern synonym used to be a data constructor for the PersistValue type. It was changed to be a pattern so that JSON-encoded database values could be parsed into their corresponding values. You should not use this, and instead prefer to pattern match on PersistLiteral_ directly.

If you use this, it will overlap a patern match on the 'PersistLiteral_, PersistLiteral, and PersistLiteralEscaped patterns. If you need to disambiguate between these constructors, pattern match on PersistLiteral_ directly.

Since: persistent-2.12.0.0

pattern PersistLiteralEscaped :: ByteString -> PersistValue

This pattern synonym used to be a data constructor on PersistValue, but was changed into a catch-all pattern synonym to allow backwards compatiblity with database types. See the documentation on PersistDbSpecific for more details.

Since: persistent-2.12.0.0

Instances

Instances details
FromJSON PersistValue 
Instance details

Defined in Database.Persist.PersistValue

ToJSON PersistValue 
Instance details

Defined in Database.Persist.PersistValue

Read PersistValue 
Instance details

Defined in Database.Persist.PersistValue

Show PersistValue 
Instance details

Defined in Database.Persist.PersistValue

Eq PersistValue 
Instance details

Defined in Database.Persist.PersistValue

Ord PersistValue 
Instance details

Defined in Database.Persist.PersistValue

FromHttpApiData PersistValue 
Instance details

Defined in Database.Persist.PersistValue

ToHttpApiData PersistValue 
Instance details

Defined in Database.Persist.PersistValue

PathPiece PersistValue 
Instance details

Defined in Database.Persist.PersistValue

PersistField PersistValue 
Instance details

Defined in Database.Persist.Class.PersistField

PersistFieldSql PersistValue 
Instance details

Defined in Database.Persist.Sql.Class

type Rep PersistValue 
Instance details

Defined in Text.PrettyPrint.GenericPretty.Instance

type Rep PersistValue = D1 ('MetaData "PersistValue" "Database.Persist.PersistValue" "persistent-2.13.3.4-K7QWPYwATzA73w61MYpbGo" 'False) (((C1 ('MetaCons "PersistText" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "PersistByteString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :+: C1 ('MetaCons "PersistInt64" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))) :+: ((C1 ('MetaCons "PersistDouble" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :+: C1 ('MetaCons "PersistRational" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational))) :+: (C1 ('MetaCons "PersistBool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :+: C1 ('MetaCons "PersistDay" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day))))) :+: (((C1 ('MetaCons "PersistTimeOfDay" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TimeOfDay)) :+: C1 ('MetaCons "PersistUTCTime" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime))) :+: (C1 ('MetaCons "PersistNull" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PersistList" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PersistValue])))) :+: ((C1 ('MetaCons "PersistMap" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, PersistValue)])) :+: C1 ('MetaCons "PersistObjectId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) :+: (C1 ('MetaCons "PersistArray" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PersistValue])) :+: C1 ('MetaCons "PersistLiteral_" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LiteralType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))))))

data SqlType #

A SQL data type. Naming attempts to reflect the underlying Haskell datatypes, eg SqlString instead of SqlVarchar. Different SQL databases may have different translations for these types.

Constructors

SqlString 
SqlInt32 
SqlInt64 
SqlReal 
SqlNumeric Word32 Word32 
SqlBool 
SqlDay 
SqlTime 
SqlDayTime

Always uses UTC timezone

SqlBlob 
SqlOther Text

a backend-specific name

Instances

Instances details
Read SqlType 
Instance details

Defined in Database.Persist.Types.Base

Show SqlType 
Instance details

Defined in Database.Persist.Types.Base

Eq SqlType 
Instance details

Defined in Database.Persist.Types.Base

Methods

(==) :: SqlType -> SqlType -> Bool #

(/=) :: SqlType -> SqlType -> Bool #

Ord SqlType 
Instance details

Defined in Database.Persist.Types.Base

Lift SqlType 
Instance details

Defined in Database.Persist.Types.Base

Methods

lift :: Quote m => SqlType -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => SqlType -> Code m SqlType #

class PersistField a where #

This class teaches Persistent how to take a custom type and marshal it to and from a PersistValue, allowing it to be stored in a database.

Examples

Expand
Simple Newtype

You can use newtype to add more type safety/readability to a basis type like ByteString. In these cases, just derive PersistField and PersistFieldSql:

{-# LANGUAGE GeneralizedNewtypeDeriving #-}

newtype HashedPassword = HashedPassword ByteString
  deriving (Eq, Show, PersistField, PersistFieldSql)
Smart Constructor Newtype

In this example, we create a PersistField instance for a newtype following the "Smart Constructor" pattern.

{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import qualified Data.Text as T
import qualified Data.Char as C

-- | An American Social Security Number
newtype SSN = SSN Text
 deriving (Eq, Show, PersistFieldSql)

mkSSN :: Text -> Either Text SSN
mkSSN t = if (T.length t == 9) && (T.all C.isDigit t)
 then Right $ SSN t
 else Left $ "Invalid SSN: " <> t

instance PersistField SSN where
  toPersistValue (SSN t) = PersistText t
  fromPersistValue (PersistText t) = mkSSN t
  -- Handle cases where the database does not give us PersistText
  fromPersistValue x = Left $ "File.hs: When trying to deserialize an SSN: expected PersistText, received: " <> T.pack (show x)

Tips:

  • This file contain dozens of PersistField instances you can look at for examples.
  • Typically custom PersistField instances will only accept a single PersistValue constructor in fromPersistValue.
  • Internal PersistField instances accept a wide variety of PersistValues to accomodate e.g. storing booleans as integers, booleans or strings.
  • If you're making a custom instance and using a SQL database, you'll also need PersistFieldSql to specify the type of the database column.

Instances

Instances details
PersistField Int16 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Int32 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Int64 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Int8 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Rational 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Word16 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Word32 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Word64 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Html 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField BlkHash Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField BlkHeight Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField BlkStatus Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField LnChanStatus Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField LnInvoiceStatus Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField Nonce Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField Privacy Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField SwapStatus Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField SwapUtxoStatus Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField UtxoLockId Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField Block Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField LnChan Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField SwapIntoLn Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField SwapUtxo Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField User Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField Code Source # 
Instance details

Defined in BtcLsp.Yesod.Data.Language

PersistField ByteString 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField SingleChanBackupBlob 
Instance details

Defined in LndClient.Data.ChannelBackup

Methods

toPersistValue :: SingleChanBackupBlob -> PersistValue #

fromPersistValue :: PersistValue -> Either Text SingleChanBackupBlob #

PersistField LndHexMacaroon 
Instance details

Defined in LndClient.Data.LndEnv

Methods

toPersistValue :: LndHexMacaroon -> PersistValue #

fromPersistValue :: PersistValue -> Either Text LndHexMacaroon #

PersistField LndHost' 
Instance details

Defined in LndClient.Data.LndEnv

PersistField LndPort' 
Instance details

Defined in LndClient.Data.LndEnv

PersistField LndWalletPassword 
Instance details

Defined in LndClient.Data.LndEnv

Methods

toPersistValue :: LndWalletPassword -> PersistValue #

fromPersistValue :: PersistValue -> Either Text LndWalletPassword #

PersistField AddIndex 
Instance details

Defined in LndClient.Data.Newtype

PersistField AezeedPassphrase 
Instance details

Defined in LndClient.Data.Newtype

Methods

toPersistValue :: AezeedPassphrase -> PersistValue #

fromPersistValue :: PersistValue -> Either Text AezeedPassphrase #

PersistField ChanId 
Instance details

Defined in LndClient.Data.Newtype

PersistField CipherSeedMnemonic 
Instance details

Defined in LndClient.Data.Newtype

Methods

toPersistValue :: CipherSeedMnemonic -> PersistValue #

fromPersistValue :: PersistValue -> Either Text CipherSeedMnemonic #

PersistField MSat 
Instance details

Defined in LndClient.Data.Newtype

PersistField NodeLocation 
Instance details

Defined in LndClient.Data.Newtype

Methods

toPersistValue :: NodeLocation -> PersistValue #

fromPersistValue :: PersistValue -> Either Text NodeLocation #

PersistField NodePubKey 
Instance details

Defined in LndClient.Data.Newtype

PersistField PaymentRequest 
Instance details

Defined in LndClient.Data.Newtype

Methods

toPersistValue :: PaymentRequest -> PersistValue #

fromPersistValue :: PersistValue -> Either Text PaymentRequest #

PersistField PendingChannelId 
Instance details

Defined in LndClient.Data.Newtype

Methods

toPersistValue :: PendingChannelId -> PersistValue #

fromPersistValue :: PersistValue -> Either Text PendingChannelId #

PersistField Psbt 
Instance details

Defined in LndClient.Data.Newtype

PersistField RHash 
Instance details

Defined in LndClient.Data.Newtype

PersistField RPreimage 
Instance details

Defined in LndClient.Data.Newtype

PersistField RawTx 
Instance details

Defined in LndClient.Data.Newtype

PersistField Seconds 
Instance details

Defined in LndClient.Data.Newtype

PersistField SettleIndex 
Instance details

Defined in LndClient.Data.Newtype

Methods

toPersistValue :: SettleIndex -> PersistValue #

fromPersistValue :: PersistValue -> Either Text SettleIndex #

PersistField LnInitiator 
Instance details

Defined in LndClient.Data.Type

Methods

toPersistValue :: LnInitiator -> PersistValue #

fromPersistValue :: PersistValue -> Either Text LnInitiator #

PersistField OverflowNatural 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField SomePersistField 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField PersistValue 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Checkmark 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Text 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Text 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Day 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField UTCTime 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField TimeOfDay 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Textarea 
Instance details

Defined in Yesod.Form.Fields

PersistField Word8 
Instance details

Defined in Database.Persist.Class.PersistField

(TypeError ((((('Text "The instance of PersistField for the Natural type was removed." :$$: 'Text "Please see the documentation for OverflowNatural if you want to ") :$$: 'Text "continue using the old behavior or want to see documentation on ") :$$: 'Text "why the instance was removed.") :$$: 'Text "") :$$: 'Text "This error instance will be removed in a future release.") :: Constraint) => PersistField Natural 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Bool 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Double 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Int 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField Word 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField (OnChainAddress mrel) Source # 
Instance details

Defined in BtcLsp.Data.Smart

PersistField (LnInvoice mrel) Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField (UnsafeOnChainAddress mrel) Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField (Uuid tab) Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistField v => PersistField (IntMap v) 
Instance details

Defined in Database.Persist.Class.PersistField

(Ord a, PersistField a) => PersistField (Set a) 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField (TxId a) 
Instance details

Defined in LndClient.Data.Newtype

PersistField (Vout a) 
Instance details

Defined in LndClient.Data.Newtype

(PersistEntity record, PersistField record, PersistField (Key record)) => PersistField (Entity record) 
Instance details

Defined in Database.Persist.Class.PersistEntity

PersistField (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

(BackendCompatible b s, PersistField (BackendKey b)) => PersistField (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), PersistField (BackendKey b)) => PersistField (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

PersistField a => PersistField (Vector a) 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField a => PersistField (Maybe a) 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField [Char] 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField a => PersistField [a] 
Instance details

Defined in Database.Persist.Class.PersistField

HasResolution a => PersistField (Fixed a) 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField v => PersistField (Map Text v) 
Instance details

Defined in Database.Persist.Class.PersistField

(PersistField a, PersistField b) => PersistField (a, b) 
Instance details

Defined in Database.Persist.Class.PersistField

PersistField (Money owner btcl mrel) Source # 
Instance details

Defined in BtcLsp.Data.Type

Methods

toPersistValue :: Money owner btcl mrel -> PersistValue #

fromPersistValue :: PersistValue -> Either Text (Money owner btcl mrel) #

data Entity record #

Datatype that represents an entity, with both its Key and its Haskell record representation.

When using a SQL-based backend (such as SQLite or PostgreSQL), an Entity may take any number of columns depending on how many fields it has. In order to reconstruct your entity on the Haskell side, persistent needs all of your entity columns and in the right order. Note that you don't need to worry about this when using persistent's API since everything is handled correctly behind the scenes.

However, if you want to issue a raw SQL command that returns an Entity, then you have to be careful with the column order. While you could use SELECT Entity.* WHERE ... and that would work most of the time, there are times when the order of the columns on your database is different from the order that persistent expects (for example, if you add a new field in the middle of you entity definition and then use the migration code -- persistent will expect the column to be in the middle, but your DBMS will put it as the last column). So, instead of using a query like the one above, you may use rawSql (from the Database.Persist.GenericSql module) with its /entity selection placeholder/ (a double question mark ??). Using rawSql the query above must be written as SELECT ?? WHERE ... Then rawSql will replace ?? with the list of all columns that we need from your entity in the right order. If your query returns two entities (i.e. (Entity backend a, Entity backend b)), then you must you use SELECT ??, ?? WHERE ..., and so on.

Constructors

Entity 

Fields

Instances

Instances details
(PersistEntity rec, PersistField typ, SymbolToField sym rec typ) => HasField (sym :: Symbol) (SqlExpr (Entity rec)) (SqlExpr (Value typ))

This instance allows you to use record.field notation with GHC 9.2's OverloadedRecordDot extension.

Example:

-- persistent model:
BlogPost
    authorId     PersonId
    title        Text

-- query:
select $ do
    bp <- from $ table @BlogPost
    pure $ bp.title

This is exactly equivalent to the following:

blogPost :: SqlExpr (Entity BlogPost)

blogPost ^. BlogPostTitle
blogPost ^. #title
blogPost.title

There's another instance defined on SqlExpr (Entity (Maybe rec)), which allows you to project from a LEFT JOINed entity.

Since: esqueleto-3.5.4.0

Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

getField :: SqlExpr (Entity rec) -> SqlExpr (Value typ) #

(PersistEntity rec, PersistField typ, SymbolToField sym rec typ) => HasField (sym :: Symbol) (SqlExpr (Maybe (Entity rec))) (SqlExpr (Value (Maybe typ)))

This instance allows you to use record.field notation with GC 9.2's OverloadedRecordDot extension.

Example:

-- persistent model:
Person
    name         Text

BlogPost
    title        Text
    authorId     PersonId

-- query:

select $ do
    (p :& bp) <- from $
        table Person
        leftJoin table BlogPost
        on do
            \(p :& bp) ->
                just p.id ==. bp.authorId
    pure (p.name, bp.title)

The following forms are all equivalent:

blogPost :: SqlExpr (Maybe (Entity BlogPost))

blogPost ?. BlogPostTitle
blogPost ?. #title
blogPost.title

Since: esqueleto-3.5.4.0

Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

getField :: SqlExpr (Maybe (Entity rec)) -> SqlExpr (Value (Maybe typ)) #

(Generic (Key record), Generic record) => Generic (Entity record) 
Instance details

Defined in Database.Persist.Class.PersistEntity

Associated Types

type Rep (Entity record) :: Type -> Type #

Methods

from :: Entity record -> Rep (Entity record) x #

to :: Rep (Entity record) x -> Entity record #

(Read (Key record), Read record) => Read (Entity record) 
Instance details

Defined in Database.Persist.Class.PersistEntity

Methods

readsPrec :: Int -> ReadS (Entity record) #

readList :: ReadS [Entity record] #

readPrec :: ReadPrec (Entity record) #

readListPrec :: ReadPrec [Entity record] #

(Show (Key record), Show record) => Show (Entity record) 
Instance details

Defined in Database.Persist.Class.PersistEntity

Methods

showsPrec :: Int -> Entity record -> ShowS #

show :: Entity record -> String #

showList :: [Entity record] -> ShowS #

Colored (Entity LnChan) Source # 
Instance details

Defined in BtcLsp.Yesod.Data.Colored

ToMaybe (SqlExpr (Entity a)) 
Instance details

Defined in Database.Esqueleto.Experimental.ToMaybe

Associated Types

type ToMaybeT (SqlExpr (Entity a)) #

Methods

toMaybe :: SqlExpr (Entity a) -> ToMaybeT (SqlExpr (Entity a)) #

FromPreprocess (SqlExpr (Entity val)) => From (SqlExpr (Entity val)) 
Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

from_ :: SqlQuery (SqlExpr (Entity val)) #

FromPreprocess (SqlExpr (Maybe (Entity val))) => From (SqlExpr (Maybe (Entity val))) 
Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

from_ :: SqlQuery (SqlExpr (Maybe (Entity val))) #

(PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val)) => FromPreprocess (SqlExpr (Entity val)) 
Instance details

Defined in Database.Esqueleto.Internal.Internal

(PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val)) => FromPreprocess (SqlExpr (Maybe (Entity val))) 
Instance details

Defined in Database.Esqueleto.Internal.Internal

(Eq (Key record), Eq record) => Eq (Entity record) 
Instance details

Defined in Database.Persist.Class.PersistEntity

Methods

(==) :: Entity record -> Entity record -> Bool #

(/=) :: Entity record -> Entity record -> Bool #

(Ord (Key record), Ord record) => Ord (Entity record) 
Instance details

Defined in Database.Persist.Class.PersistEntity

Methods

compare :: Entity record -> Entity record -> Ordering #

(<) :: Entity record -> Entity record -> Bool #

(<=) :: Entity record -> Entity record -> Bool #

(>) :: Entity record -> Entity record -> Bool #

(>=) :: Entity record -> Entity record -> Bool #

max :: Entity record -> Entity record -> Entity record #

min :: Entity record -> Entity record -> Entity record #

(PersistEntity record, PersistField record, PersistField (Key record)) => PersistField (Entity record) 
Instance details

Defined in Database.Persist.Class.PersistEntity

(PersistField record, PersistEntity record) => PersistFieldSql (Entity record) 
Instance details

Defined in Database.Persist.Sql.Class

Methods

sqlType :: Proxy (Entity record) -> SqlType #

(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 => SqlSelect (SqlExpr (Entity a)) (Entity a)

You may return an Entity from a select query.

Instance details

Defined in Database.Esqueleto.Internal.Internal

PersistEntity a => SqlSelect (SqlExpr (Maybe (Entity a))) (Maybe (Entity a))

You may return a possibly-NULL Entity from a select query.

Instance details

Defined in Database.Esqueleto.Internal.Internal

type Rep (Entity record) 
Instance details

Defined in Database.Persist.Class.PersistEntity

type Rep (Entity record) = D1 ('MetaData "Entity" "Database.Persist.Class.PersistEntity" "persistent-2.13.3.4-K7QWPYwATzA73w61MYpbGo" 'False) (C1 ('MetaCons "Entity" 'PrefixI 'True) (S1 ('MetaSel ('Just "entityKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Key record)) :*: S1 ('MetaSel ('Just "entityVal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 record)))
type ToMaybeT (SqlExpr (Entity a)) 
Instance details

Defined in Database.Esqueleto.Experimental.ToMaybe

class (PersistField (Key record), ToJSON (Key record), FromJSON (Key record), Show (Key record), Read (Key record), Eq (Key record), Ord (Key record)) => PersistEntity record where #

Persistent serialized Haskell records to the database. A Database Entity (A row in SQL, a document in MongoDB, etc) corresponds to a Key plus a Haskell record.

For every Haskell record type stored in the database there is a corresponding PersistEntity instance. An instance of PersistEntity contains meta-data for the record. PersistEntity also helps abstract over different record types. That way the same query interface can return a PersistEntity, with each query returning different types of Haskell records.

Some advanced type system capabilities are used to make this process type-safe. Persistent users usually don't need to understand the class associated data and functions.

Associated Types

type PersistEntityBackend record #

Persistent allows multiple different backends (databases).

data Key record #

By default, a backend will automatically generate the key Instead you can specify a Primary key made up of unique values.

data EntityField record :: Type -> Type #

An EntityField is parameterised by the Haskell record it belongs to and the additional type of that field.

As of persistent-2.11.0.0, it's possible to use the OverloadedLabels language extension to refer to EntityField values polymorphically. See the documentation on SymbolToField for more information.

data Unique record #

Unique keys besides the Key.

Methods

keyToValues :: Key record -> [PersistValue] #

A lower-level key operation.

keyFromValues :: [PersistValue] -> Either Text (Key record) #

A lower-level key operation.

persistIdField :: EntityField record (Key record) #

A meta-operation to retrieve the Key EntityField.

entityDef :: proxy record -> EntityDef #

Retrieve the EntityDef meta-data for the record.

persistFieldDef :: EntityField record typ -> FieldDef #

Return meta-data for a given EntityField.

toPersistFields :: record -> [SomePersistField] #

A meta-operation to get the database fields of a record.

fromPersistValues :: [PersistValue] -> Either Text record #

A lower-level operation to convert from database values to a Haskell record.

persistUniqueKeys :: record -> [Unique record] #

A meta operation to retrieve all the Unique keys.

persistUniqueToFieldNames :: Unique record -> NonEmpty (FieldNameHS, FieldNameDB) #

A lower level operation.

persistUniqueToValues :: Unique record -> [PersistValue] #

A lower level operation.

fieldLens :: EntityField record field -> forall (f :: Type -> Type). Functor f => (field -> f field) -> Entity record -> f (Entity record) #

Use a PersistField as a lens.

keyFromRecordM :: Maybe (record -> Key record) #

Extract a Key record from a record value. Currently, this is only defined for entities using the Primary syntax for natural/composite keys. In a future version of persistent which incorporates the ID directly into the entity, this will always be Just.

Since: persistent-2.11.0.0

Instances

Instances details
PersistEntity Block Source # 
Instance details

Defined in BtcLsp.Storage.Model

Associated Types

type PersistEntityBackend Block #

data Key Block #

data EntityField Block :: Type -> Type #

data Unique Block #

PersistEntity LnChan Source # 
Instance details

Defined in BtcLsp.Storage.Model

Associated Types

type PersistEntityBackend LnChan #

data Key LnChan #

data EntityField LnChan :: Type -> Type #

data Unique LnChan #

PersistEntity SwapIntoLn Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistEntity SwapUtxo Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistEntity User Source # 
Instance details

Defined in BtcLsp.Storage.Model

Associated Types

type PersistEntityBackend User #

data Key User #

data EntityField User :: Type -> Type #

data Unique User #

type family PersistEntityBackend record #

Persistent allows multiple different backends (databases).

data family Key record #

By default, a backend will automatically generate the key Instead you can specify a Primary key made up of unique values.

Instances

Instances details
SymbolToField "blockId" SwapUtxo BlockId Source # 
Instance details

Defined in BtcLsp.Storage.Model

SymbolToField "swapIntoLnId" SwapUtxo SwapIntoLnId Source # 
Instance details

Defined in BtcLsp.Storage.Model

SymbolToField "userId" SwapIntoLn UserId Source # 
Instance details

Defined in BtcLsp.Storage.Model

SymbolToField "id" Block (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

SymbolToField "id" LnChan (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

SymbolToField "id" SwapIntoLn (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

SymbolToField "id" SwapUtxo (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

SymbolToField "id" User (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

SymbolToField "refundBlockId" SwapUtxo (Maybe BlockId) Source # 
Instance details

Defined in BtcLsp.Storage.Model

SymbolToField "swapIntoLnId" LnChan (Maybe SwapIntoLnId) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToBackendKey SqlBackend a => TryFrom Natural (Key a) Source # 
Instance details

Defined in BtcLsp.Data.Orphan

Out (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

docPrec :: Int -> Key Block -> Doc #

doc :: Key Block -> Doc #

docList :: [Key Block] -> Doc #

Out (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

docPrec :: Int -> Key LnChan -> Doc #

doc :: Key LnChan -> Doc #

docList :: [Key LnChan] -> Doc #

Out (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Out (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Out (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

docPrec :: Int -> Key User -> Doc #

doc :: Key User -> Doc #

docList :: [Key User] -> Doc #

FromJSON (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

FromJSON (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

FromJSON (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

FromJSON (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

FromJSON (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToJSON (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToJSON (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToJSON (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToJSON (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToJSON (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Generic (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Associated Types

type Rep (Key Block) :: Type -> Type #

Methods

from :: Key Block -> Rep (Key Block) x #

to :: Rep (Key Block) x -> Key Block #

Generic (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Associated Types

type Rep (Key LnChan) :: Type -> Type #

Methods

from :: Key LnChan -> Rep (Key LnChan) x #

to :: Rep (Key LnChan) x -> Key LnChan #

Generic (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Associated Types

type Rep (Key SwapIntoLn) :: Type -> Type #

Generic (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Associated Types

type Rep (Key SwapUtxo) :: Type -> Type #

Methods

from :: Key SwapUtxo -> Rep (Key SwapUtxo) x #

to :: Rep (Key SwapUtxo) x -> Key SwapUtxo #

Generic (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Associated Types

type Rep (Key User) :: Type -> Type #

Methods

from :: Key User -> Rep (Key User) x #

to :: Rep (Key User) x -> Key User #

Read (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Read (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Read (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Read (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Read (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Show (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Show (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Show (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Show (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Show (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

showsPrec :: Int -> Key User -> ShowS #

show :: Key User -> String #

showList :: [Key User] -> ShowS #

Eq (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

(==) :: Key Block -> Key Block -> Bool #

(/=) :: Key Block -> Key Block -> Bool #

Eq (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

(==) :: Key LnChan -> Key LnChan -> Bool #

(/=) :: Key LnChan -> Key LnChan -> Bool #

Eq (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Eq (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Eq (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

(==) :: Key User -> Key User -> Bool #

(/=) :: Key User -> Key User -> Bool #

Ord (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Ord (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Ord (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Ord (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Ord (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

compare :: Key User -> Key User -> Ordering #

(<) :: Key User -> Key User -> Bool #

(<=) :: Key User -> Key User -> Bool #

(>) :: Key User -> Key User -> Bool #

(>=) :: Key User -> Key User -> Bool #

max :: Key User -> Key User -> Key User #

min :: Key User -> Key User -> Key User #

FromHttpApiData (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

FromHttpApiData (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

FromHttpApiData (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

FromHttpApiData (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

FromHttpApiData (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToHttpApiData (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToHttpApiData (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToHttpApiData (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToHttpApiData (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToHttpApiData (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PathPiece (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PathPiece (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PathPiece (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PathPiece (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PathPiece (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistField (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistFieldSql (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

sqlType :: Proxy (Key Block) -> SqlType #

PersistFieldSql (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

sqlType :: Proxy (Key LnChan) -> SqlType #

PersistFieldSql (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistFieldSql (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistFieldSql (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

sqlType :: Proxy (Key User) -> SqlType #

(PersistEntity a, PersistEntityBackend a ~ backend, IsPersistBackend backend) => RawSql (Key a) 
Instance details

Defined in Database.Persist.Sql.Class

ToBackendKey SqlBackend a => TryFrom (Key a) Natural Source # 
Instance details

Defined in BtcLsp.Data.Orphan

newtype Key Block Source # 
Instance details

Defined in BtcLsp.Storage.Model

newtype Key LnChan Source # 
Instance details

Defined in BtcLsp.Storage.Model

newtype Key SwapIntoLn Source # 
Instance details

Defined in BtcLsp.Storage.Model

newtype Key SwapUtxo Source # 
Instance details

Defined in BtcLsp.Storage.Model

newtype Key User Source # 
Instance details

Defined in BtcLsp.Storage.Model

type Rep (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

type Rep (Key Block) = D1 ('MetaData "Key" "BtcLsp.Storage.Model" "btc-lsp-0.1.0.0-inplace" 'True) (C1 ('MetaCons "BlockKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BackendKey SqlBackend))))
type Rep (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

type Rep (Key LnChan) = D1 ('MetaData "Key" "BtcLsp.Storage.Model" "btc-lsp-0.1.0.0-inplace" 'True) (C1 ('MetaCons "LnChanKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLnChanKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BackendKey SqlBackend))))
type Rep (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

type Rep (Key SwapIntoLn) = D1 ('MetaData "Key" "BtcLsp.Storage.Model" "btc-lsp-0.1.0.0-inplace" 'True) (C1 ('MetaCons "SwapIntoLnKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSwapIntoLnKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BackendKey SqlBackend))))
type Rep (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

type Rep (Key SwapUtxo) = D1 ('MetaData "Key" "BtcLsp.Storage.Model" "btc-lsp-0.1.0.0-inplace" 'True) (C1 ('MetaCons "SwapUtxoKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSwapUtxoKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BackendKey SqlBackend))))
type Rep (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

type Rep (Key User) = D1 ('MetaData "Key" "BtcLsp.Storage.Model" "btc-lsp-0.1.0.0-inplace" 'True) (C1 ('MetaCons "UserKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unUserKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BackendKey SqlBackend))))
type KeyEntity (Key x) 
Instance details

Defined in Yesod.Auth

type KeyEntity (Key x) = x

data family EntityField record :: Type -> Type #

An EntityField is parameterised by the Haskell record it belongs to and the additional type of that field.

As of persistent-2.11.0.0, it's possible to use the OverloadedLabels language extension to refer to EntityField values polymorphically. See the documentation on SymbolToField for more information.

Instances

Instances details
SymbolToField sym rec typ => IsLabel sym (EntityField rec typ)

This instance delegates to SymbolToField to provide OverloadedLabels support to the EntityField type.

Since: persistent-2.11.0.0

Instance details

Defined in Database.Persist.Class.PersistEntity

Methods

fromLabel :: EntityField rec typ #

data EntityField Block typ Source # 
Instance details

Defined in BtcLsp.Storage.Model

data EntityField LnChan typ Source # 
Instance details

Defined in BtcLsp.Storage.Model

data EntityField SwapIntoLn typ Source # 
Instance details

Defined in BtcLsp.Storage.Model

data EntityField SwapUtxo typ Source # 
Instance details

Defined in BtcLsp.Storage.Model

data EntityField User typ Source # 
Instance details

Defined in BtcLsp.Storage.Model

data family Unique record #

Unique keys besides the Key.

Instances

Instances details
FinalResult (Unique val) 
Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

finalR :: Unique val -> KnowResult (Unique val) #

data Unique Block Source # 
Instance details

Defined in BtcLsp.Storage.Model

data Unique LnChan Source # 
Instance details

Defined in BtcLsp.Storage.Model

data Unique SwapIntoLn Source # 
Instance details

Defined in BtcLsp.Storage.Model

data Unique SwapUtxo Source # 
Instance details

Defined in BtcLsp.Storage.Model

data Unique User Source # 
Instance details

Defined in BtcLsp.Storage.Model

data family BackendKey backend #

Instances

Instances details
Out (BackendKey SqlBackend) Source # 
Instance details

Defined in BtcLsp.Data.Orphan

(BackendCompatible b s, FromJSON (BackendKey b)) => FromJSON (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), FromJSON (BackendKey b)) => FromJSON (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, ToJSON (BackendKey b)) => ToJSON (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), ToJSON (BackendKey b)) => ToJSON (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Bounded (BackendKey b)) => Bounded (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Bounded (BackendKey b)) => Bounded (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Enum (BackendKey b)) => Enum (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Enum (BackendKey b)) => Enum (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Num (BackendKey b)) => Num (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Num (BackendKey b)) => Num (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Read (BackendKey b)) => Read (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Read (BackendKey b)) => Read (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Integral (BackendKey b)) => Integral (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Integral (BackendKey b)) => Integral (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Real (BackendKey b)) => Real (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Real (BackendKey b)) => Real (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Show (BackendKey b)) => Show (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Show (BackendKey b)) => Show (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Eq (BackendKey b)) => Eq (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Eq (BackendKey b)) => Eq (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Ord (BackendKey b)) => Ord (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Ord (BackendKey b)) => Ord (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, PersistField (BackendKey b)) => PersistField (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), PersistField (BackendKey b)) => PersistField (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, PersistFieldSql (BackendKey b)) => PersistFieldSql (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), PersistFieldSql (BackendKey b)) => PersistFieldSql (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

newtype BackendKey SqlReadBackend 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

newtype BackendKey SqlWriteBackend 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

newtype BackendKey SqlBackend 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

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.13.3.4-K7QWPYwATzA73w61MYpbGo" '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.13.3.4-K7QWPYwATzA73w61MYpbGo" '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.13.3.4-K7QWPYwATzA73w61MYpbGo" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
newtype BackendKey (RawPostgresql b) 
Instance details

Defined in Database.Persist.Postgresql

newtype BackendKey (Compatible b s) 
Instance details

Defined in Database.Persist.Compatible.Types

data family BackendKey backend #

Instances

Instances details
Out (BackendKey SqlBackend) Source # 
Instance details

Defined in BtcLsp.Data.Orphan

(BackendCompatible b s, FromJSON (BackendKey b)) => FromJSON (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), FromJSON (BackendKey b)) => FromJSON (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, ToJSON (BackendKey b)) => ToJSON (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), ToJSON (BackendKey b)) => ToJSON (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Bounded (BackendKey b)) => Bounded (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Bounded (BackendKey b)) => Bounded (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Enum (BackendKey b)) => Enum (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Enum (BackendKey b)) => Enum (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Num (BackendKey b)) => Num (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Num (BackendKey b)) => Num (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Read (BackendKey b)) => Read (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Read (BackendKey b)) => Read (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Integral (BackendKey b)) => Integral (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Integral (BackendKey b)) => Integral (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Real (BackendKey b)) => Real (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Real (BackendKey b)) => Real (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Show (BackendKey b)) => Show (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Show (BackendKey b)) => Show (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Eq (BackendKey b)) => Eq (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Eq (BackendKey b)) => Eq (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, Ord (BackendKey b)) => Ord (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), Ord (BackendKey b)) => Ord (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, PersistField (BackendKey b)) => PersistField (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), PersistField (BackendKey b)) => PersistField (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

(BackendCompatible b s, PersistFieldSql (BackendKey b)) => PersistFieldSql (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), PersistFieldSql (BackendKey b)) => PersistFieldSql (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

newtype BackendKey SqlReadBackend 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

newtype BackendKey SqlWriteBackend 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

newtype BackendKey SqlBackend 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

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.13.3.4-K7QWPYwATzA73w61MYpbGo" '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.13.3.4-K7QWPYwATzA73w61MYpbGo" '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.13.3.4-K7QWPYwATzA73w61MYpbGo" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
newtype BackendKey (RawPostgresql b) 
Instance details

Defined in Database.Persist.Postgresql

newtype BackendKey (Compatible b s) 
Instance details

Defined in Database.Persist.Compatible.Types

class (PersistEntity record, PersistEntityBackend record ~ backend, PersistCore backend) => ToBackendKey backend record #

ToBackendKey converts a PersistEntity Key into a BackendKey This can be used by each backend to convert between a Key and a plain Haskell type. For Sql, that is done with toSqlKey and fromSqlKey.

By default, a PersistEntity uses the default BackendKey for its Key and is an instance of ToBackendKey

A Key that instead uses a custom type will not be an instance of ToBackendKey.

Minimal complete definition

toBackendKey, fromBackendKey

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
HasPersistBackend SqlBackend 
Instance details

Defined in Database.Persist.SqlBackend.Internal

Associated Types

type BaseBackend SqlBackend #

IsPersistBackend SqlBackend 
Instance details

Defined in Database.Persist.SqlBackend.Internal

ToBackendKey SqlBackend Block Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToBackendKey SqlBackend LnChan Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToBackendKey SqlBackend SwapIntoLn Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToBackendKey SqlBackend SwapUtxo Source # 
Instance details

Defined in BtcLsp.Storage.Model

ToBackendKey SqlBackend User Source # 
Instance details

Defined in BtcLsp.Storage.Model

Out (BackendKey SqlBackend) Source # 
Instance details

Defined in BtcLsp.Data.Orphan

newtype BackendKey SqlBackend 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

type BaseBackend SqlBackend 
Instance details

Defined in Database.Persist.SqlBackend.Internal

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.13.3.4-K7QWPYwATzA73w61MYpbGo" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

selectFirst :: forall (m :: Type -> Type) record. (PersistQueryRead backend, MonadIO m, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m (Maybe (Entity record)) #

Get just the first record for the criterion.

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

Runs a migration. If the migration fails to parse or if any of the migrations are unsafe, then this throws a PersistUnsafeMigrationException.

derivePersistField :: String -> Q [Dec] #

Automatically creates a valid PersistField instance for any datatype that has valid Show and Read instances. Can be very convenient for Enum types.

upsertBy #

Arguments

:: forall (m :: Type -> Type) record. (MonadIO m, PersistEntity record, IsPersistBackend (PersistEntityBackend record)) 
=> Unique record

uniqueness constraint to find by

-> record

new record to insert

-> [SqlExpr (Entity record) -> SqlExpr Update]

updates to perform if the record already exists

-> ReaderT SqlBackend m (Entity record)

the record in the database after the operation

deleteKey :: forall backend val (m :: Type -> Type). (PersistStore backend, BaseBackend backend ~ PersistEntityBackend val, MonadIO m, PersistEntity val) => Key val -> ReaderT backend m () #

Synonym for delete that does not clash with esqueleto's delete.

updateCount :: forall (m :: Type -> Type) val. (MonadIO m, PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val)) => (SqlExpr (Entity val) -> SqlQuery ()) -> SqlWriteT m Int64 #

Same as update, but returns the number of rows affected.

update :: forall (m :: Type -> Type) val. (MonadIO m, PersistEntity val, BackendCompatible SqlBackend (PersistEntityBackend val)) => (SqlExpr (Entity val) -> SqlQuery ()) -> SqlWriteT m () #

Execute an esqueleto UPDATE query inside persistent's SqlPersistT monad. Note that currently there are no type checks for statements that should not appear on a UPDATE query.

Example of usage:

update $ \p -> do
set p [ PersonAge =. just (val thisYear) -. p ^. PersonBorn ]
where_ $ isNothing (p ^. PersonAge)

select :: forall a r (m :: Type -> Type). (SqlSelect a r, MonadIO m) => SqlQuery a -> SqlReadT m [r] #

Execute an esqueleto SELECT query inside persistent's SqlPersistT monad and return a list of rows.

We've seen that from has some magic about which kinds of things you may bring into scope. This select function also has some magic for which kinds of things you may bring back to Haskell-land by using SqlQuery's return:

  • You may return a SqlExpr (Entity v) for an entity v (i.e., like the * in SQL), which is then returned to Haskell-land as just Entity v.
  • You may return a SqlExpr (Maybe (Entity v)) for an entity v that may be NULL, which is then returned to Haskell-land as Maybe (Entity v). Used for OUTER JOINs.
  • You may return a SqlExpr (Value t) for a value t (i.e., a single column), where t is any instance of PersistField, which is then returned to Haskell-land as Value t. You may use Value to return projections of an Entity (see (^.) and (?.)) or to return any other value calculated on the query (e.g., countRows or subSelect).

The SqlSelect a r class has functional dependencies that allow type information to flow both from a to r and vice-versa. This means that you'll almost never have to give any type signatures for esqueleto queries. For example, the query select $ from $ \p -> return p alone is ambiguous, but in the context of

do ps <- select $
         from $ \p ->
         return p
   liftIO $ mapM_ (putStrLn . personName . entityVal) ps

we are able to infer from that single personName . entityVal function composition that the p inside the query is of type SqlExpr (Entity Person).

from :: From a => (a -> SqlQuery b) -> SqlQuery b #

FROM clause: bring entities into scope.

Note that this function will be replaced by the one in Database.Esqueleto.Experimental in version 4.0.0.0 of the library. The Experimental module has a dramatically improved means for introducing tables and entities that provides more power and less potential for runtime errors.

This function internally uses two type classes in order to provide some flexibility of how you may call it. Internally we refer to these type classes as the two different magics.

The innermost magic allows you to use from with the following types:

  • expr (Entity val), which brings a single entity into scope.
  • expr (Maybe (Entity val)), which brings a single entity that may be NULL into scope. Used for OUTER JOINs.
  • A JOIN of any other two types allowed by the innermost magic, where a JOIN may be an InnerJoin, a CrossJoin, a LeftOuterJoin, a RightOuterJoin, or a FullOuterJoin. The JOINs have left fixity.

The outermost magic allows you to use from on any tuples of types supported by innermost magic (and also tuples of tuples, and so on), up to 8-tuples.

Note that using from for the same entity twice does work and corresponds to a self-join. You don't even need to use two different calls to from, you may use a JOIN or a tuple.

The following are valid examples of uses of from (the types of the arguments of the lambda are inside square brackets):

from $ \person -> ...
from $ \(person, blogPost) -> ...
from $ \(p `LeftOuterJoin` mb) -> ...
from $ \(p1 `InnerJoin` f `InnerJoin` p2) -> ...
from $ \((p1 `InnerJoin` f) `InnerJoin` p2) -> ...

The types of the arguments to the lambdas above are, respectively:

person
  :: ( Esqueleto query expr backend
     , PersistEntity Person
     , PersistEntityBackend Person ~ backend
     ) => expr (Entity Person)
(person, blogPost)
  :: (...) => (expr (Entity Person), expr (Entity BlogPost))
(p `LeftOuterJoin` mb)
  :: (...) => InnerJoin (expr (Entity Person)) (expr (Maybe (Entity BlogPost)))
(p1 `InnerJoin` f `InnerJoin` p2)
  :: (...) => InnerJoin
                (InnerJoin (expr (Entity Person))
                           (expr (Entity Follow)))
                (expr (Entity Person))
(p1 `InnerJoin` (f `InnerJoin` p2)) ::
  :: (...) => InnerJoin
                (expr (Entity Person))
                (InnerJoin (expr (Entity Follow))
                           (expr (Entity Person)))

Note that some backends may not support all kinds of JOINs.

(/=.) :: (PersistEntity val, PersistField a) => EntityField val a -> SqlExpr (Value a) -> SqlExpr (Entity val) -> SqlExpr Update infixr 3 #

(+=.) :: (PersistEntity val, PersistField a) => EntityField val a -> SqlExpr (Value a) -> SqlExpr (Entity val) -> SqlExpr Update infixr 3 #

(=.) :: (PersistEntity val, PersistField typ) => EntityField val typ -> SqlExpr (Value typ) -> SqlExpr (Entity val) -> SqlExpr Update infixr 3 #

set :: PersistEntity val => SqlExpr (Entity val) -> [SqlExpr (Entity val) -> SqlExpr Update] -> SqlQuery () #

SET clause used on UPDATEs. Note that while it's not a type error to use this function on a SELECT, it will most certainly result in a runtime error.

notIn :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (ValueList typ) -> SqlExpr (Value Bool) #

NOT IN operator.

in_ :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (ValueList typ) -> SqlExpr (Value Bool) #

IN operator. For example if you want to select all Persons by a list of IDs:

SELECT *
FROM Person
WHERE Person.id IN (?)

In esqueleto, we may write the same query above as:

select $
from $ \person -> do
where_ $ person ^. PersonId `in_` valList personIds
return person

Where personIds is of type [Key Person].

valList :: PersistField typ => [typ] -> SqlExpr (ValueList typ) #

Lift a list of constant value from Haskell-land to the query.

(!=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 #

(<.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 #

(>.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 #

(>=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 #

(==.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool) infix 4 #

nothing :: SqlExpr (Value (Maybe typ)) #

NULL value.

just :: SqlExpr (Value typ) -> SqlExpr (Value (Maybe typ)) #

Analogous to Just, promotes a value of type typ into one of type Maybe typ. It should hold that val . Just === just . val.

isNothing :: PersistField typ => SqlExpr (Value (Maybe typ)) -> SqlExpr (Value Bool) #

IS NULL comparison.

For IS NOT NULL, you can negate this with not_, as in not_ (isNothing (person ^. PersonAge))

Warning: Persistent and Esqueleto have different behavior for != Nothing:

HaskellSQL
Persistent!=. NothingIS NOT NULL
Esqueleto!=. Nothing!= NULL

In SQL, = NULL and != NULL return NULL instead of true or false. For this reason, you very likely do not want to use !=. Nothing in Esqueleto. You may find these hlint rules helpful to enforce this:

- error: {lhs: v Database.Esqueleto.==. Database.Esqueleto.nothing, rhs: Database.Esqueleto.isNothing v, name: Use Esqueleto's isNothing}
- error: {lhs: v Database.Esqueleto.==. Database.Esqueleto.val Nothing, rhs: Database.Esqueleto.isNothing v, name: Use Esqueleto's isNothing}
- error: {lhs: v Database.Esqueleto.!=. Database.Esqueleto.nothing, rhs: not_ (Database.Esqueleto.isNothing v), name: Use Esqueleto's not isNothing}
- error: {lhs: v Database.Esqueleto.!=. Database.Esqueleto.val Nothing, rhs: not_ (Database.Esqueleto.isNothing v), name: Use Esqueleto's not isNothing}

val :: PersistField typ => typ -> SqlExpr (Value typ) #

Lift a constant value from Haskell-land to the query.

(?.) :: (PersistEntity val, PersistField typ) => SqlExpr (Maybe (Entity val)) -> EntityField val typ -> SqlExpr (Value (Maybe typ)) #

Project a field of an entity that may be null.

(^.) :: forall typ val. (PersistEntity val, PersistField typ) => SqlExpr (Entity val) -> EntityField val typ -> SqlExpr (Value typ) infixl 9 #

Project a field of an entity.

locking :: LockingKind -> SqlQuery () #

Add a locking clause to the query. Please read LockingKind documentation and your RDBMS manual.

If multiple calls to locking are made on the same query, the last one is used.

Since: esqueleto-2.2.7

limit :: Int64 -> SqlQuery () #

LIMIT. Limit the number of returned rows.

desc :: PersistField a => SqlExpr (Value a) -> SqlExpr OrderBy #

Descending order of this field or SqlExpression.

asc :: PersistField a => SqlExpr (Value a) -> SqlExpr OrderBy #

Ascending order of this field or SqlExpression.

orderBy :: [SqlExpr OrderBy] -> SqlQuery () #

ORDER BY clause. See also asc and desc.

Multiple calls to orderBy get concatenated on the final query, including distinctOnOrderBy.

on :: SqlExpr (Value Bool) -> SqlQuery () #

An ON clause, useful to describe how two tables are related. Cross joins and tuple-joins do not need an on clause, but InnerJoin and the various outer joins do.

Database.Esqueleto.Experimental in version 4.0.0.0 of the library. The Experimental module has a dramatically improved means for introducing tables and entities that provides more power and less potential for runtime errors.

If you don't include an on clause (or include too many!) then a runtime exception will be thrown.

As an example, consider this simple join:

select $
from $ \(foo `InnerJoin` bar) -> do
  on (foo ^. FooId ==. bar ^. BarFooId)
  ...

We need to specify the clause for joining the two columns together. If we had this:

select $
from $ \(foo `CrossJoin` bar) -> do
  ...

Then we can safely omit the on clause, because the cross join will make pairs of all records possible.

You can do multiple on clauses in a query. This query joins three tables, and has two on clauses:

select $
from $ \(foo `InnerJoin` bar `InnerJoin` baz) -> do
  on (baz ^. BazId ==. bar ^. BarBazId)
  on (foo ^. FooId ==. bar ^. BarFooId)
  ...

Old versions of esqueleto required that you provide the on clauses in reverse order. This restriction has been lifted - you can now provide on clauses in any order, and the SQL should work itself out. The above query is now totally equivalent to this:

select $
from $ \(foo `InnerJoin` bar `InnerJoin` baz) -> do
  on (foo ^. FooId ==. bar ^. BarFooId)
  on (baz ^. BazId ==. bar ^. BarBazId)
  ...

where_ :: SqlExpr (Value Bool) -> SqlQuery () #

WHERE clause: restrict the query's result.

unValue :: Value a -> a #

data InnerJoin a b infixl 2 #

Data type that represents an INNER JOIN (see LeftOuterJoin for an example).

Constructors

a `InnerJoin` b infixl 2 

Instances

Instances details
IsJoinKind InnerJoin 
Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

smartJoin :: a -> b -> InnerJoin a b #

reifyJoinKind :: InnerJoin a b -> JoinKind #

FromPreprocess (InnerJoin a b) => From (InnerJoin a b) 
Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

from_ :: SqlQuery (InnerJoin a b) #

data LeftOuterJoin a b infixl 2 #

Data type that represents a LEFT OUTER JOIN. For example,

select $
from $ \(person `LeftOuterJoin` pet) ->
  ...

is translated into

SELECT ...
FROM Person LEFT OUTER JOIN Pet
...

See also: from.

Constructors

a `LeftOuterJoin` b infixl 2 

Instances

Instances details
IsJoinKind LeftOuterJoin 
Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

smartJoin :: a -> b -> LeftOuterJoin a b #

reifyJoinKind :: LeftOuterJoin a b -> JoinKind #

FromPreprocess (LeftOuterJoin a b) => From (LeftOuterJoin a b) 
Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

from_ :: SqlQuery (LeftOuterJoin a b) #

data RightOuterJoin a b infixl 2 #

Data type that represents a RIGHT OUTER JOIN (see LeftOuterJoin for an example).

Constructors

a `RightOuterJoin` b infixl 2 

Instances

Instances details
IsJoinKind RightOuterJoin 
Instance details

Defined in Database.Esqueleto.Internal.Internal

FromPreprocess (RightOuterJoin a b) => From (RightOuterJoin a b) 
Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

from_ :: SqlQuery (RightOuterJoin a b) #

data FullOuterJoin a b infixl 2 #

Data type that represents a FULL OUTER JOIN (see LeftOuterJoin for an example).

Constructors

a `FullOuterJoin` b infixl 2 

Instances

Instances details
IsJoinKind FullOuterJoin 
Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

smartJoin :: a -> b -> FullOuterJoin a b #

reifyJoinKind :: FullOuterJoin a b -> JoinKind #

FromPreprocess (FullOuterJoin a b) => From (FullOuterJoin a b) 
Instance details

Defined in Database.Esqueleto.Internal.Internal

Methods

from_ :: SqlQuery (FullOuterJoin a b) #

data LockingKind #

Different kinds of locking clauses supported by locking.

Note that each RDBMS has different locking support. The constructors of this datatype specify only the syntax of the locking mechanism, not its semantics. For example, even though both MySQL and PostgreSQL support ForUpdate, there are no guarantees that they will behave the same.

Since: esqueleto-2.2.7

Constructors

ForUpdate

FOR UPDATE syntax. Supported by MySQL, Oracle and PostgreSQL.

Since: esqueleto-2.2.7

ForUpdateSkipLocked

FOR UPDATE SKIP LOCKED syntax. Supported by MySQL, Oracle and PostgreSQL.

Since: esqueleto-2.2.7

ForShare

FOR SHARE syntax. Supported by PostgreSQL.

Since: esqueleto-2.2.7

LockInShareMode

LOCK IN SHARE MODE syntax. Supported by MySQL.

Since: esqueleto-2.2.7

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 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

PersistFieldSql Word16 
Instance details

Defined in Database.Persist.Sql.Class

PersistFieldSql Word32 
Instance details

Defined in Database.Persist.Sql.Class

PersistFieldSql Word64 
Instance details

Defined in Database.Persist.Sql.Class

PersistFieldSql Html 
Instance details

Defined in Database.Persist.Sql.Class

Methods

sqlType :: Proxy Html -> SqlType #

PersistFieldSql BlkHash Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistFieldSql BlkHeight Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistFieldSql BlkStatus Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistFieldSql LnChanStatus Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistFieldSql LnInvoiceStatus Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistFieldSql Nonce Source # 
Instance details

Defined in BtcLsp.Data.Type

Methods

sqlType :: Proxy Nonce -> SqlType #

PersistFieldSql Privacy Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistFieldSql SwapStatus Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistFieldSql SwapUtxoStatus Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistFieldSql UtxoLockId Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistFieldSql Block Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

sqlType :: Proxy Block -> SqlType #

PersistFieldSql LnChan Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistFieldSql SwapIntoLn Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistFieldSql SwapUtxo Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistFieldSql User Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

sqlType :: Proxy User -> SqlType #

PersistFieldSql Code Source # 
Instance details

Defined in BtcLsp.Yesod.Data.Language

Methods

sqlType :: Proxy Code -> SqlType #

PersistFieldSql ByteString 
Instance details

Defined in Database.Persist.Sql.Class

PersistFieldSql SingleChanBackupBlob 
Instance details

Defined in LndClient.Data.ChannelBackup

Methods

sqlType :: Proxy SingleChanBackupBlob -> SqlType #

PersistFieldSql LndHexMacaroon 
Instance details

Defined in LndClient.Data.LndEnv

Methods

sqlType :: Proxy LndHexMacaroon -> SqlType #

PersistFieldSql LndHost' 
Instance details

Defined in LndClient.Data.LndEnv

Methods

sqlType :: Proxy LndHost' -> SqlType #

PersistFieldSql LndPort' 
Instance details

Defined in LndClient.Data.LndEnv

Methods

sqlType :: Proxy LndPort' -> SqlType #

PersistFieldSql LndWalletPassword 
Instance details

Defined in LndClient.Data.LndEnv

Methods

sqlType :: Proxy LndWalletPassword -> SqlType #

PersistFieldSql AddIndex 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy AddIndex -> SqlType #

PersistFieldSql AezeedPassphrase 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy AezeedPassphrase -> SqlType #

PersistFieldSql ChanId 
Instance details

Defined in LndClient.Data.Newtype

PersistFieldSql CipherSeedMnemonic 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy CipherSeedMnemonic -> SqlType #

PersistFieldSql MSat 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy MSat -> SqlType #

PersistFieldSql NodeLocation 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy NodeLocation -> SqlType #

PersistFieldSql NodePubKey 
Instance details

Defined in LndClient.Data.Newtype

PersistFieldSql PaymentRequest 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy PaymentRequest -> SqlType #

PersistFieldSql PendingChannelId 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy PendingChannelId -> SqlType #

PersistFieldSql Psbt 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy Psbt -> SqlType #

PersistFieldSql RHash 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy RHash -> SqlType #

PersistFieldSql RPreimage 
Instance details

Defined in LndClient.Data.Newtype

PersistFieldSql RawTx 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy RawTx -> SqlType #

PersistFieldSql Seconds 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy Seconds -> SqlType #

PersistFieldSql SettleIndex 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy SettleIndex -> SqlType #

PersistFieldSql LnInitiator 
Instance details

Defined in LndClient.Data.Type

Methods

sqlType :: Proxy LnInitiator -> 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: persistent-2.11.0

Instance details

Defined in Database.Persist.Sql.Class

PersistFieldSql PersistValue 
Instance details

Defined in Database.Persist.Sql.Class

PersistFieldSql Checkmark 
Instance details

Defined in Database.Persist.Sql.Class

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

PersistFieldSql TimeOfDay 
Instance details

Defined in Database.Persist.Sql.Class

PersistFieldSql Textarea 
Instance details

Defined in Yesod.Form.Fields

PersistFieldSql Word8 
Instance details

Defined in Database.Persist.Sql.Class

Methods

sqlType :: Proxy Word8 -> 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

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 (OnChainAddress mrel) Source # 
Instance details

Defined in BtcLsp.Data.Smart

Methods

sqlType :: Proxy (OnChainAddress mrel) -> SqlType #

PersistFieldSql (LnInvoice mrel) Source # 
Instance details

Defined in BtcLsp.Data.Type

Methods

sqlType :: Proxy (LnInvoice mrel) -> SqlType #

PersistFieldSql (UnsafeOnChainAddress mrel) Source # 
Instance details

Defined in BtcLsp.Data.Type

PersistFieldSql (Uuid tab) Source # 
Instance details

Defined in BtcLsp.Data.Type

Methods

sqlType :: Proxy (Uuid tab) -> 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 #

PersistFieldSql (TxId a) 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy (TxId a) -> SqlType #

PersistFieldSql (Vout a) 
Instance details

Defined in LndClient.Data.Newtype

Methods

sqlType :: Proxy (Vout a) -> SqlType #

(PersistField record, PersistEntity record) => PersistFieldSql (Entity record) 
Instance details

Defined in Database.Persist.Sql.Class

Methods

sqlType :: Proxy (Entity record) -> SqlType #

PersistFieldSql (Key Block) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

sqlType :: Proxy (Key Block) -> SqlType #

PersistFieldSql (Key LnChan) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

sqlType :: Proxy (Key LnChan) -> SqlType #

PersistFieldSql (Key SwapIntoLn) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistFieldSql (Key SwapUtxo) Source # 
Instance details

Defined in BtcLsp.Storage.Model

PersistFieldSql (Key User) Source # 
Instance details

Defined in BtcLsp.Storage.Model

Methods

sqlType :: Proxy (Key User) -> SqlType #

(BackendCompatible b s, PersistFieldSql (BackendKey b)) => PersistFieldSql (BackendKey (Compatible b s)) 
Instance details

Defined in Database.Persist.Compatible.Types

(PersistCore b, PersistCore (RawPostgresql b), PersistFieldSql (BackendKey b)) => PersistFieldSql (BackendKey (RawPostgresql b)) 
Instance details

Defined in Database.Persist.Postgresql

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 #

PersistFieldSql (Money owner btcl mrel) Source # 
Instance details

Defined in BtcLsp.Data.Type

Methods

sqlType :: Proxy (Money owner btcl mrel) -> 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

PersistField a => RawSql (Single a) 
Instance details

Defined in Database.Persist.Sql.Class

RawSql a => RawSql (Maybe a)

Since: persistent-1.0.1

Instance details

Defined in Database.Persist.Sql.Class

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

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

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

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.

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

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

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: persistent-1.2.0

upsertManyWhere #

Arguments

:: forall record backend (m :: Type -> Type). (backend ~ PersistEntityBackend record, BackendCompatible SqlBackend backend, PersistEntityBackend record ~ SqlBackend, PersistEntity record, OnlyOneUniqueKey record, MonadIO m) 
=> [record]

A list of the records you want to insert, or update

-> [HandleUpdateCollision record]

A list of the fields you want to copy over.

-> [Update record]

A list of the updates to apply that aren't dependent on the record being inserted.

-> [Filter record]

A filter condition that dictates the scope of the updates

-> ReaderT backend m () 

Postgres specific upsertManyWhere. This method does the following: It will insert a record if no matching unique key exists. If a unique key exists, it will update the relevant field with a user-supplied value, however, it will only do this update on a user-supplied condition. For example, here's how this method could be called like such:

upsertManyWhere [record] [recordField =. newValue] [recordField !=. newValue]

Called thusly, this method will insert a new record (if none exists) OR update a recordField with a new value assuming the condition in the last block is met.

Since: persistent-postgresql-2.12.1.0

copyField :: PersistField typ => EntityField record typ -> HandleUpdateCollision record #

Copy the field directly from the record.

Since: persistent-postgresql-2.12.1.0

createPostgresqlPool #

Arguments

:: (MonadUnliftIO m, MonadLoggerIO m) 
=> ConnectionString

Connection string to the database.

-> Int

Number of connections to be kept open in the pool.

-> m (Pool SqlBackend) 

Create a PostgreSQL connection pool. Note that it's your responsibility to properly close the connection pool when unneeded. Use withPostgresqlPool for an automatic resource control.

type ConnectionString = ByteString #

A libpq connection string. A simple example of connection string would be "host=localhost port=5432 user=test dbname=test password=test". Please read libpq's documentation at https://www.postgresql.org/docs/current/static/libpq-connect.html for more details on how to create such strings.