tsweb-0.1.1: An API binding Web.Spock to Database.Beam

Safe HaskellNone
LanguageHaskell2010

TsWeb.Db

Description

This builds on TsWeb.Types.Db's read-only/read-write discrimination by providing query functions to perform read-only operations, and an execute function to run updates, inserts, and deletes (and also selects as appropriate). All of these are performed as TsActionCtxT actions so as to nicely integrate with Spock. Finally, because I'm not a fan of exceptions, all of these functions trap Postgres errors and convert them into sum-type results.

I'm not yet providing shortcuts for the beam-postgres specific functions. I'm not actually sure that I need to (IIRC they all build Pg actions), but I will be adding them if necessary.

Synopsis

Documentation

class Typeable (a :: k) #

The class Typeable allows a concrete representation of a type to be calculated.

Minimal complete definition

typeRep#

class Generic a #

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

A Generic instance must satisfy the following laws:

from . toid
to . fromid

Minimal complete definition

from, to

Instances
Generic Bool 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Bool :: Type -> Type #

Methods

from :: Bool -> Rep Bool x #

to :: Rep Bool x -> Bool #

Generic Ordering 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Ordering :: Type -> Type #

Methods

from :: Ordering -> Rep Ordering x #

to :: Rep Ordering x -> Ordering #

Generic Exp 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Exp :: Type -> Type #

Methods

from :: Exp -> Rep Exp x #

to :: Rep Exp x -> Exp #

Generic Match 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Match :: Type -> Type #

Methods

from :: Match -> Rep Match x #

to :: Rep Match x -> Match #

Generic Clause 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Clause :: Type -> Type #

Methods

from :: Clause -> Rep Clause x #

to :: Rep Clause x -> Clause #

Generic Pat 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Pat :: Type -> Type #

Methods

from :: Pat -> Rep Pat x #

to :: Rep Pat x -> Pat #

Generic Type 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Type :: Type -> Type #

Methods

from :: Type -> Rep Type x #

to :: Rep Type x -> Type #

Generic Dec 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Dec :: Type -> Type #

Methods

from :: Dec -> Rep Dec x #

to :: Rep Dec x -> Dec #

Generic Name 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Name :: Type -> Type #

Methods

from :: Name -> Rep Name x #

to :: Rep Name x -> Name #

Generic FunDep 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FunDep :: Type -> Type #

Methods

from :: FunDep -> Rep FunDep x #

to :: Rep FunDep x -> FunDep #

Generic InjectivityAnn 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep InjectivityAnn :: Type -> Type #

Generic Overlap 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Overlap :: Type -> Type #

Methods

from :: Overlap -> Rep Overlap x #

to :: Rep Overlap x -> Overlap #

Generic () 
Instance details

Defined in GHC.Generics

Associated Types

type Rep () :: Type -> Type #

Methods

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

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

Generic MultiHeader 
Instance details

Defined in Web.Spock.Internal.Wire

Associated Types

type Rep MultiHeader :: Type -> Type #

Generic HttpMethod 
Instance details

Defined in Web.Spock.Internal.Wire

Associated Types

type Rep HttpMethod :: Type -> Type #

Generic SpockMethod 
Instance details

Defined in Web.Spock.Internal.Wire

Associated Types

type Rep SpockMethod :: Type -> Type #

Generic Con 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Con :: Type -> Type #

Methods

from :: Con -> Rep Con x #

to :: Rep Con x -> Con #

Generic Value 
Instance details

Defined in Data.Aeson.Types.Internal

Associated Types

type Rep Value :: Type -> Type #

Methods

from :: Value -> Rep Value x #

to :: Rep Value x -> Value #

Generic Void 
Instance details

Defined in Data.Void

Associated Types

type Rep Void :: Type -> Type #

Methods

from :: Void -> Rep Void x #

to :: Rep Void x -> Void #

Generic Version 
Instance details

Defined in Data.Version

Associated Types

type Rep Version :: Type -> Type #

Methods

from :: Version -> Rep Version x #

to :: Rep Version x -> Version #

Generic ExitCode 
Instance details

Defined in GHC.IO.Exception

Associated Types

type Rep ExitCode :: Type -> Type #

Methods

from :: ExitCode -> Rep ExitCode x #

to :: Rep ExitCode x -> ExitCode #

Generic All 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep All :: Type -> Type #

Methods

from :: All -> Rep All x #

to :: Rep All x -> All #

Generic Any 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep Any :: Type -> Type #

Methods

from :: Any -> Rep Any x #

to :: Rep Any x -> Any #

Generic Fixity 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Fixity :: Type -> Type #

Methods

from :: Fixity -> Rep Fixity x #

to :: Rep Fixity x -> Fixity #

Generic Associativity 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Associativity :: Type -> Type #

Generic SourceUnpackedness 
Instance details

Defined in GHC.Generics

Associated Types

type Rep SourceUnpackedness :: Type -> Type #

Generic SourceStrictness 
Instance details

Defined in GHC.Generics

Associated Types

type Rep SourceStrictness :: Type -> Type #

Generic DecidedStrictness 
Instance details

Defined in GHC.Generics

Associated Types

type Rep DecidedStrictness :: Type -> Type #

Generic DatabaseStateSource 
Instance details

Defined in Database.Beam.Migrate.Actions

Associated Types

type Rep DatabaseStateSource :: Type -> Type #

Generic HsConstraintDefinition 
Instance details

Defined in Database.Beam.Haskell.Syntax

Associated Types

type Rep HsConstraintDefinition :: Type -> Type #

Generic HsImport 
Instance details

Defined in Database.Beam.Haskell.Syntax

Associated Types

type Rep HsImport :: Type -> Type #

Methods

from :: HsImport -> Rep HsImport x #

to :: Rep HsImport x -> HsImport #

Generic HsDataType 
Instance details

Defined in Database.Beam.Haskell.Syntax

Associated Types

type Rep HsDataType :: Type -> Type #

Generic HsType 
Instance details

Defined in Database.Beam.Haskell.Syntax

Associated Types

type Rep HsType :: Type -> Type #

Methods

from :: HsType -> Rep HsType x #

to :: Rep HsType x -> HsType #

Generic HsExpr 
Instance details

Defined in Database.Beam.Haskell.Syntax

Associated Types

type Rep HsExpr :: Type -> Type #

Methods

from :: HsExpr -> Rep HsExpr x #

to :: Rep HsExpr x -> HsExpr #

Generic HsNone 
Instance details

Defined in Database.Beam.Haskell.Syntax

Associated Types

type Rep HsNone :: Type -> Type #

Methods

from :: HsNone -> Rep HsNone x #

to :: Rep HsNone x -> HsNone #

Generic TableExistsPredicate 
Instance details

Defined in Database.Beam.Migrate.Checks

Associated Types

type Rep TableExistsPredicate :: Type -> Type #

Generic TableHasPrimaryKey 
Instance details

Defined in Database.Beam.Migrate.Checks

Associated Types

type Rep TableHasPrimaryKey :: Type -> Type #

Generic PredicateSpecificity 
Instance details

Defined in Database.Beam.Migrate.Types.Predicates

Associated Types

type Rep PredicateSpecificity :: Type -> Type #

Generic PgHasExtension 
Instance details

Defined in Database.Beam.Postgres.Extensions

Associated Types

type Rep PgHasExtension :: Type -> Type #

Methods

from :: PgHasExtension -> Rep PgHasExtension x #

to :: Rep PgHasExtension x -> PgHasExtension #

Generic PgBoundType 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Associated Types

type Rep PgBoundType :: Type -> Type #

Generic PgSelectLockingStrength 
Instance details

Defined in Database.Beam.Postgres.Syntax

Associated Types

type Rep PgSelectLockingStrength :: Type -> Type #

Generic PgSelectLockingOptions 
Instance details

Defined in Database.Beam.Postgres.Syntax

Associated Types

type Rep PgSelectLockingOptions :: Type -> Type #

Generic PgDataTypeDescr 
Instance details

Defined in Database.Beam.Postgres.Syntax

Associated Types

type Rep PgDataTypeDescr :: Type -> Type #

Generic PgHasEnum 
Instance details

Defined in Database.Beam.Postgres.Syntax

Associated Types

type Rep PgHasEnum :: Type -> Type #

Generic ConnectInfo 
Instance details

Defined in Database.PostgreSQL.Simple.Internal

Associated Types

type Rep ConnectInfo :: Type -> Type #

Generic Extension 
Instance details

Defined in GHC.LanguageExtensions.Type

Associated Types

type Rep Extension :: Type -> Type #

Generic ForeignSrcLang 
Instance details

Defined in GHC.ForeignSrcLang.Type

Associated Types

type Rep ForeignSrcLang :: Type -> Type #

Generic Boxed 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep Boxed :: Type -> Type #

Methods

from :: Boxed -> Rep Boxed x #

to :: Rep Boxed x -> Boxed #

Generic Tool 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep Tool :: Type -> Type #

Methods

from :: Tool -> Rep Tool x #

to :: Rep Tool x -> Tool #

Generic SrcLoc 
Instance details

Defined in Language.Haskell.Exts.SrcLoc

Associated Types

type Rep SrcLoc :: Type -> Type #

Methods

from :: SrcLoc -> Rep SrcLoc x #

to :: Rep SrcLoc x -> SrcLoc #

Generic SrcSpan 
Instance details

Defined in Language.Haskell.Exts.SrcLoc

Associated Types

type Rep SrcSpan :: Type -> Type #

Methods

from :: SrcSpan -> Rep SrcSpan x #

to :: Rep SrcSpan x -> SrcSpan #

Generic SrcSpanInfo 
Instance details

Defined in Language.Haskell.Exts.SrcLoc

Associated Types

type Rep SrcSpanInfo :: Type -> Type #

Generic Mode 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Mode :: Type -> Type #

Methods

from :: Mode -> Rep Mode x #

to :: Rep Mode x -> Mode #

Generic Style 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Style :: Type -> Type #

Methods

from :: Style -> Rep Style x #

to :: Rep Style x -> Style #

Generic IPRange 
Instance details

Defined in Data.IP.Range

Associated Types

type Rep IPRange :: Type -> Type #

Methods

from :: IPRange -> Rep IPRange x #

to :: Rep IPRange x -> IPRange #

Generic IP 
Instance details

Defined in Data.IP.Addr

Associated Types

type Rep IP :: Type -> Type #

Methods

from :: IP -> Rep IP x #

to :: Rep IP x -> IP #

Generic IPv4 
Instance details

Defined in Data.IP.Addr

Associated Types

type Rep IPv4 :: Type -> Type #

Methods

from :: IPv4 -> Rep IPv4 x #

to :: Rep IPv4 x -> IPv4 #

Generic IPv6 
Instance details

Defined in Data.IP.Addr

Associated Types

type Rep IPv6 :: Type -> Type #

Methods

from :: IPv6 -> Rep IPv6 x #

to :: Rep IPv6 x -> IPv6 #

Generic URI 
Instance details

Defined in Network.URI

Associated Types

type Rep URI :: Type -> Type #

Methods

from :: URI -> Rep URI x #

to :: Rep URI x -> URI #

Generic Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Associated Types

type Rep Doc :: Type -> Type #

Methods

from :: Doc -> Rep Doc x #

to :: Rep Doc x -> Doc #

Generic TextDetails 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep TextDetails :: Type -> Type #

Generic ModName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep ModName :: Type -> Type #

Methods

from :: ModName -> Rep ModName x #

to :: Rep ModName x -> ModName #

Generic PkgName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PkgName :: Type -> Type #

Methods

from :: PkgName -> Rep PkgName x #

to :: Rep PkgName x -> PkgName #

Generic Module 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Module :: Type -> Type #

Methods

from :: Module -> Rep Module x #

to :: Rep Module x -> Module #

Generic OccName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep OccName :: Type -> Type #

Methods

from :: OccName -> Rep OccName x #

to :: Rep OccName x -> OccName #

Generic NameFlavour 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep NameFlavour :: Type -> Type #

Generic NameSpace 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep NameSpace :: Type -> Type #

Generic Loc 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Loc :: Type -> Type #

Methods

from :: Loc -> Rep Loc x #

to :: Rep Loc x -> Loc #

Generic Info 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Info :: Type -> Type #

Methods

from :: Info -> Rep Info x #

to :: Rep Info x -> Info #

Generic ModuleInfo 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep ModuleInfo :: Type -> Type #

Generic Fixity 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Fixity :: Type -> Type #

Methods

from :: Fixity -> Rep Fixity x #

to :: Rep Fixity x -> Fixity #

Generic FixityDirection 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FixityDirection :: Type -> Type #

Generic Lit 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Lit :: Type -> Type #

Methods

from :: Lit -> Rep Lit x #

to :: Rep Lit x -> Lit #

Generic Body 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Body :: Type -> Type #

Methods

from :: Body -> Rep Body x #

to :: Rep Body x -> Body #

Generic Guard 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Guard :: Type -> Type #

Methods

from :: Guard -> Rep Guard x #

to :: Rep Guard x -> Guard #

Generic Stmt 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Stmt :: Type -> Type #

Methods

from :: Stmt -> Rep Stmt x #

to :: Rep Stmt x -> Stmt #

Generic Range 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Range :: Type -> Type #

Methods

from :: Range -> Rep Range x #

to :: Rep Range x -> Range #

Generic DerivClause 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DerivClause :: Type -> Type #

Generic DerivStrategy 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DerivStrategy :: Type -> Type #

Generic TypeFamilyHead 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TypeFamilyHead :: Type -> Type #

Generic TySynEqn 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TySynEqn :: Type -> Type #

Methods

from :: TySynEqn -> Rep TySynEqn x #

to :: Rep TySynEqn x -> TySynEqn #

Generic Foreign 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Foreign :: Type -> Type #

Methods

from :: Foreign -> Rep Foreign x #

to :: Rep Foreign x -> Foreign #

Generic Callconv 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Callconv :: Type -> Type #

Methods

from :: Callconv -> Rep Callconv x #

to :: Rep Callconv x -> Callconv #

Generic Safety 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Safety :: Type -> Type #

Methods

from :: Safety -> Rep Safety x #

to :: Rep Safety x -> Safety #

Generic Pragma 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Pragma :: Type -> Type #

Methods

from :: Pragma -> Rep Pragma x #

to :: Rep Pragma x -> Pragma #

Generic Inline 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Inline :: Type -> Type #

Methods

from :: Inline -> Rep Inline x #

to :: Rep Inline x -> Inline #

Generic RuleMatch 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep RuleMatch :: Type -> Type #

Generic Phases 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Phases :: Type -> Type #

Methods

from :: Phases -> Rep Phases x #

to :: Rep Phases x -> Phases #

Generic RuleBndr 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep RuleBndr :: Type -> Type #

Methods

from :: RuleBndr -> Rep RuleBndr x #

to :: Rep RuleBndr x -> RuleBndr #

Generic AnnTarget 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep AnnTarget :: Type -> Type #

Generic SourceUnpackedness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep SourceUnpackedness :: Type -> Type #

Generic SourceStrictness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep SourceStrictness :: Type -> Type #

Generic DecidedStrictness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DecidedStrictness :: Type -> Type #

Generic Bang 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Bang :: Type -> Type #

Methods

from :: Bang -> Rep Bang x #

to :: Rep Bang x -> Bang #

Generic PatSynDir 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PatSynDir :: Type -> Type #

Generic PatSynArgs 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PatSynArgs :: Type -> Type #

Generic TyVarBndr 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TyVarBndr :: Type -> Type #

Generic FamilyResultSig 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FamilyResultSig :: Type -> Type #

Generic TyLit 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TyLit :: Type -> Type #

Methods

from :: TyLit -> Rep TyLit x #

to :: Rep TyLit x -> TyLit #

Generic Role 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Role :: Type -> Type #

Methods

from :: Role -> Rep Role x #

to :: Rep Role x -> Role #

Generic AnnLookup 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep AnnLookup :: Type -> Type #

Generic PgNullOrdering 
Instance details

Defined in Database.Beam.Postgres.Syntax

Associated Types

type Rep PgNullOrdering :: Type -> Type #

Methods

from :: PgNullOrdering -> Rep PgNullOrdering x #

to :: Rep PgNullOrdering x -> PgNullOrdering #

Generic [a] 
Instance details

Defined in GHC.Generics

Associated Types

type Rep [a] :: Type -> Type #

Methods

from :: [a] -> Rep [a] x #

to :: Rep [a] x -> [a] #

Generic (Maybe a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Maybe a) :: Type -> Type #

Methods

from :: Maybe a -> Rep (Maybe a) x #

to :: Rep (Maybe a) x -> Maybe a #

Generic (Par1 p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Par1 p) :: Type -> Type #

Methods

from :: Par1 p -> Rep (Par1 p) x #

to :: Rep (Par1 p) x -> Par1 p #

Generic (Only a) 
Instance details

Defined in Data.Tuple.Only

Associated Types

type Rep (Only a) :: Type -> Type #

Methods

from :: Only a -> Rep (Only a) x #

to :: Rep (Only a) x -> Only a #

Generic (Complex a) 
Instance details

Defined in Data.Complex

Associated Types

type Rep (Complex a) :: Type -> Type #

Methods

from :: Complex a -> Rep (Complex a) x #

to :: Rep (Complex a) x -> Complex a #

Generic (Min a) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Min a) :: Type -> Type #

Methods

from :: Min a -> Rep (Min a) x #

to :: Rep (Min a) x -> Min a #

Generic (Max a) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Max a) :: Type -> Type #

Methods

from :: Max a -> Rep (Max a) x #

to :: Rep (Max a) x -> Max a #

Generic (First a) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (First a) :: Type -> Type #

Methods

from :: First a -> Rep (First a) x #

to :: Rep (First a) x -> First a #

Generic (Last a) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Last a) :: Type -> Type #

Methods

from :: Last a -> Rep (Last a) x #

to :: Rep (Last a) x -> Last a #

Generic (WrappedMonoid m) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (WrappedMonoid m) :: Type -> Type #

Generic (Option a) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Option a) :: Type -> Type #

Methods

from :: Option a -> Rep (Option a) x #

to :: Rep (Option a) x -> Option a #

Generic (ZipList a) 
Instance details

Defined in Control.Applicative

Associated Types

type Rep (ZipList a) :: Type -> Type #

Methods

from :: ZipList a -> Rep (ZipList a) x #

to :: Rep (ZipList a) x -> ZipList a #

Generic (Identity a) 
Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep (Identity a) :: Type -> Type #

Methods

from :: Identity a -> Rep (Identity a) x #

to :: Rep (Identity a) x -> Identity a #

Generic (First a) 
Instance details

Defined in Data.Monoid

Associated Types

type Rep (First a) :: Type -> Type #

Methods

from :: First a -> Rep (First a) x #

to :: Rep (First a) x -> First a #

Generic (Last a) 
Instance details

Defined in Data.Monoid

Associated Types

type Rep (Last a) :: Type -> Type #

Methods

from :: Last a -> Rep (Last a) x #

to :: Rep (Last a) x -> Last a #

Generic (Dual a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Dual a) :: Type -> Type #

Methods

from :: Dual a -> Rep (Dual a) x #

to :: Rep (Dual a) x -> Dual a #

Generic (Endo a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Endo a) :: Type -> Type #

Methods

from :: Endo a -> Rep (Endo a) x #

to :: Rep (Endo a) x -> Endo a #

Generic (Sum a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Sum a) :: Type -> Type #

Methods

from :: Sum a -> Rep (Sum a) x #

to :: Rep (Sum a) x -> Sum a #

Generic (Product a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Product a) :: Type -> Type #

Methods

from :: Product a -> Rep (Product a) x #

to :: Rep (Product a) x -> Product a #

Generic (Down a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Down a) :: Type -> Type #

Methods

from :: Down a -> Rep (Down a) x #

to :: Rep (Down a) x -> Down a #

Generic (NonEmpty a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (NonEmpty a) :: Type -> Type #

Methods

from :: NonEmpty a -> Rep (NonEmpty a) x #

to :: Rep (NonEmpty a) x -> NonEmpty a #

Generic (MeasuredDatabaseState be) 
Instance details

Defined in Database.Beam.Migrate.Actions

Associated Types

type Rep (MeasuredDatabaseState be) :: Type -> Type #

Methods

from :: MeasuredDatabaseState be -> Rep (MeasuredDatabaseState be) x #

to :: Rep (MeasuredDatabaseState be) x -> MeasuredDatabaseState be #

Generic (TableColumnHasConstraint be) 
Instance details

Defined in Database.Beam.Migrate.Checks

Associated Types

type Rep (TableColumnHasConstraint be) :: Type -> Type #

Generic (PgRangeBound a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Associated Types

type Rep (PgRangeBound a) :: Type -> Type #

Methods

from :: PgRangeBound a -> Rep (PgRangeBound a) x #

to :: Rep (PgRangeBound a) x -> PgRangeBound a #

Generic (PgJSONKey f) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Associated Types

type Rep (PgJSONKey f) :: Type -> Type #

Methods

from :: PgJSONKey f -> Rep (PgJSONKey f) x #

to :: Rep (PgJSONKey f) x -> PgJSONKey f #

Generic (Tree a) 
Instance details

Defined in Data.Tree

Associated Types

type Rep (Tree a) :: Type -> Type #

Methods

from :: Tree a -> Rep (Tree a) x #

to :: Rep (Tree a) x -> Tree a #

Generic (FingerTree a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (FingerTree a) :: Type -> Type #

Methods

from :: FingerTree a -> Rep (FingerTree a) x #

to :: Rep (FingerTree a) x -> FingerTree a #

Generic (Digit a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (Digit a) :: Type -> Type #

Methods

from :: Digit a -> Rep (Digit a) x #

to :: Rep (Digit a) x -> Digit a #

Generic (Node a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (Node a) :: Type -> Type #

Methods

from :: Node a -> Rep (Node a) x #

to :: Rep (Node a) x -> Node a #

Generic (Elem a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (Elem a) :: Type -> Type #

Methods

from :: Elem a -> Rep (Elem a) x #

to :: Rep (Elem a) x -> Elem a #

Generic (ViewL a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (ViewL a) :: Type -> Type #

Methods

from :: ViewL a -> Rep (ViewL a) x #

to :: Rep (ViewL a) x -> ViewL a #

Generic (ViewR a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (ViewR a) :: Type -> Type #

Methods

from :: ViewR a -> Rep (ViewR a) x #

to :: Rep (ViewR a) x -> ViewR a #

Generic (Finite n) 
Instance details

Defined in Data.Finite.Internal

Associated Types

type Rep (Finite n) :: Type -> Type #

Methods

from :: Finite n -> Rep (Finite n) x #

to :: Rep (Finite n) x -> Finite n #

Generic (ModuleName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ModuleName l) :: Type -> Type #

Methods

from :: ModuleName l -> Rep (ModuleName l) x #

to :: Rep (ModuleName l) x -> ModuleName l #

Generic (SpecialCon l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (SpecialCon l) :: Type -> Type #

Methods

from :: SpecialCon l -> Rep (SpecialCon l) x #

to :: Rep (SpecialCon l) x -> SpecialCon l #

Generic (QName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (QName l) :: Type -> Type #

Methods

from :: QName l -> Rep (QName l) x #

to :: Rep (QName l) x -> QName l #

Generic (Name l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Name l) :: Type -> Type #

Methods

from :: Name l -> Rep (Name l) x #

to :: Rep (Name l) x -> Name l #

Generic (IPName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (IPName l) :: Type -> Type #

Methods

from :: IPName l -> Rep (IPName l) x #

to :: Rep (IPName l) x -> IPName l #

Generic (QOp l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (QOp l) :: Type -> Type #

Methods

from :: QOp l -> Rep (QOp l) x #

to :: Rep (QOp l) x -> QOp l #

Generic (Op l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Op l) :: Type -> Type #

Methods

from :: Op l -> Rep (Op l) x #

to :: Rep (Op l) x -> Op l #

Generic (CName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (CName l) :: Type -> Type #

Methods

from :: CName l -> Rep (CName l) x #

to :: Rep (CName l) x -> CName l #

Generic (Module l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Module l) :: Type -> Type #

Methods

from :: Module l -> Rep (Module l) x #

to :: Rep (Module l) x -> Module l #

Generic (ModuleHead l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ModuleHead l) :: Type -> Type #

Methods

from :: ModuleHead l -> Rep (ModuleHead l) x #

to :: Rep (ModuleHead l) x -> ModuleHead l #

Generic (ExportSpecList l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ExportSpecList l) :: Type -> Type #

Generic (ExportSpec l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ExportSpec l) :: Type -> Type #

Methods

from :: ExportSpec l -> Rep (ExportSpec l) x #

to :: Rep (ExportSpec l) x -> ExportSpec l #

Generic (EWildcard l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (EWildcard l) :: Type -> Type #

Methods

from :: EWildcard l -> Rep (EWildcard l) x #

to :: Rep (EWildcard l) x -> EWildcard l #

Generic (Namespace l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Namespace l) :: Type -> Type #

Methods

from :: Namespace l -> Rep (Namespace l) x #

to :: Rep (Namespace l) x -> Namespace l #

Generic (ImportDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ImportDecl l) :: Type -> Type #

Methods

from :: ImportDecl l -> Rep (ImportDecl l) x #

to :: Rep (ImportDecl l) x -> ImportDecl l #

Generic (ImportSpecList l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ImportSpecList l) :: Type -> Type #

Generic (ImportSpec l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ImportSpec l) :: Type -> Type #

Methods

from :: ImportSpec l -> Rep (ImportSpec l) x #

to :: Rep (ImportSpec l) x -> ImportSpec l #

Generic (Assoc l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Assoc l) :: Type -> Type #

Methods

from :: Assoc l -> Rep (Assoc l) x #

to :: Rep (Assoc l) x -> Assoc l #

Generic (Decl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Decl l) :: Type -> Type #

Methods

from :: Decl l -> Rep (Decl l) x #

to :: Rep (Decl l) x -> Decl l #

Generic (PatternSynDirection l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (PatternSynDirection l) :: Type -> Type #

Generic (TypeEqn l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (TypeEqn l) :: Type -> Type #

Methods

from :: TypeEqn l -> Rep (TypeEqn l) x #

to :: Rep (TypeEqn l) x -> TypeEqn l #

Generic (Annotation l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Annotation l) :: Type -> Type #

Methods

from :: Annotation l -> Rep (Annotation l) x #

to :: Rep (Annotation l) x -> Annotation l #

Generic (BooleanFormula l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (BooleanFormula l) :: Type -> Type #

Generic (Role l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Role l) :: Type -> Type #

Methods

from :: Role l -> Rep (Role l) x #

to :: Rep (Role l) x -> Role l #

Generic (DataOrNew l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (DataOrNew l) :: Type -> Type #

Methods

from :: DataOrNew l -> Rep (DataOrNew l) x #

to :: Rep (DataOrNew l) x -> DataOrNew l #

Generic (InjectivityInfo l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (InjectivityInfo l) :: Type -> Type #

Generic (ResultSig l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ResultSig l) :: Type -> Type #

Methods

from :: ResultSig l -> Rep (ResultSig l) x #

to :: Rep (ResultSig l) x -> ResultSig l #

Generic (DeclHead l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (DeclHead l) :: Type -> Type #

Methods

from :: DeclHead l -> Rep (DeclHead l) x #

to :: Rep (DeclHead l) x -> DeclHead l #

Generic (InstRule l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (InstRule l) :: Type -> Type #

Methods

from :: InstRule l -> Rep (InstRule l) x #

to :: Rep (InstRule l) x -> InstRule l #

Generic (InstHead l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (InstHead l) :: Type -> Type #

Methods

from :: InstHead l -> Rep (InstHead l) x #

to :: Rep (InstHead l) x -> InstHead l #

Generic (Deriving l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Deriving l) :: Type -> Type #

Methods

from :: Deriving l -> Rep (Deriving l) x #

to :: Rep (Deriving l) x -> Deriving l #

Generic (DerivStrategy l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (DerivStrategy l) :: Type -> Type #

Generic (Binds l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Binds l) :: Type -> Type #

Methods

from :: Binds l -> Rep (Binds l) x #

to :: Rep (Binds l) x -> Binds l #

Generic (IPBind l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (IPBind l) :: Type -> Type #

Methods

from :: IPBind l -> Rep (IPBind l) x #

to :: Rep (IPBind l) x -> IPBind l #

Generic (Match l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Match l) :: Type -> Type #

Methods

from :: Match l -> Rep (Match l) x #

to :: Rep (Match l) x -> Match l #

Generic (QualConDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (QualConDecl l) :: Type -> Type #

Methods

from :: QualConDecl l -> Rep (QualConDecl l) x #

to :: Rep (QualConDecl l) x -> QualConDecl l #

Generic (ConDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ConDecl l) :: Type -> Type #

Methods

from :: ConDecl l -> Rep (ConDecl l) x #

to :: Rep (ConDecl l) x -> ConDecl l #

Generic (FieldDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (FieldDecl l) :: Type -> Type #

Methods

from :: FieldDecl l -> Rep (FieldDecl l) x #

to :: Rep (FieldDecl l) x -> FieldDecl l #

Generic (GadtDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (GadtDecl l) :: Type -> Type #

Methods

from :: GadtDecl l -> Rep (GadtDecl l) x #

to :: Rep (GadtDecl l) x -> GadtDecl l #

Generic (ClassDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ClassDecl l) :: Type -> Type #

Methods

from :: ClassDecl l -> Rep (ClassDecl l) x #

to :: Rep (ClassDecl l) x -> ClassDecl l #

Generic (InstDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (InstDecl l) :: Type -> Type #

Methods

from :: InstDecl l -> Rep (InstDecl l) x #

to :: Rep (InstDecl l) x -> InstDecl l #

Generic (BangType l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (BangType l) :: Type -> Type #

Methods

from :: BangType l -> Rep (BangType l) x #

to :: Rep (BangType l) x -> BangType l #

Generic (Unpackedness l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Unpackedness l) :: Type -> Type #

Methods

from :: Unpackedness l -> Rep (Unpackedness l) x #

to :: Rep (Unpackedness l) x -> Unpackedness l #

Generic (Rhs l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Rhs l) :: Type -> Type #

Methods

from :: Rhs l -> Rep (Rhs l) x #

to :: Rep (Rhs l) x -> Rhs l #

Generic (GuardedRhs l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (GuardedRhs l) :: Type -> Type #

Methods

from :: GuardedRhs l -> Rep (GuardedRhs l) x #

to :: Rep (GuardedRhs l) x -> GuardedRhs l #

Generic (Type l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Type l) :: Type -> Type #

Methods

from :: Type l -> Rep (Type l) x #

to :: Rep (Type l) x -> Type l #

Generic (MaybePromotedName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (MaybePromotedName l) :: Type -> Type #

Generic (Promoted l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Promoted l) :: Type -> Type #

Methods

from :: Promoted l -> Rep (Promoted l) x #

to :: Rep (Promoted l) x -> Promoted l #

Generic (TyVarBind l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (TyVarBind l) :: Type -> Type #

Methods

from :: TyVarBind l -> Rep (TyVarBind l) x #

to :: Rep (TyVarBind l) x -> TyVarBind l #

Generic (FunDep l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (FunDep l) :: Type -> Type #

Methods

from :: FunDep l -> Rep (FunDep l) x #

to :: Rep (FunDep l) x -> FunDep l #

Generic (Context l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Context l) :: Type -> Type #

Methods

from :: Context l -> Rep (Context l) x #

to :: Rep (Context l) x -> Context l #

Generic (Asst l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Asst l) :: Type -> Type #

Methods

from :: Asst l -> Rep (Asst l) x #

to :: Rep (Asst l) x -> Asst l #

Generic (Literal l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Literal l) :: Type -> Type #

Methods

from :: Literal l -> Rep (Literal l) x #

to :: Rep (Literal l) x -> Literal l #

Generic (Sign l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Sign l) :: Type -> Type #

Methods

from :: Sign l -> Rep (Sign l) x #

to :: Rep (Sign l) x -> Sign l #

Generic (Exp l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Exp l) :: Type -> Type #

Methods

from :: Exp l -> Rep (Exp l) x #

to :: Rep (Exp l) x -> Exp l #

Generic (XName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (XName l) :: Type -> Type #

Methods

from :: XName l -> Rep (XName l) x #

to :: Rep (XName l) x -> XName l #

Generic (XAttr l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (XAttr l) :: Type -> Type #

Methods

from :: XAttr l -> Rep (XAttr l) x #

to :: Rep (XAttr l) x -> XAttr l #

Generic (Bracket l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Bracket l) :: Type -> Type #

Methods

from :: Bracket l -> Rep (Bracket l) x #

to :: Rep (Bracket l) x -> Bracket l #

Generic (Splice l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Splice l) :: Type -> Type #

Methods

from :: Splice l -> Rep (Splice l) x #

to :: Rep (Splice l) x -> Splice l #

Generic (Safety l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Safety l) :: Type -> Type #

Methods

from :: Safety l -> Rep (Safety l) x #

to :: Rep (Safety l) x -> Safety l #

Generic (CallConv l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (CallConv l) :: Type -> Type #

Methods

from :: CallConv l -> Rep (CallConv l) x #

to :: Rep (CallConv l) x -> CallConv l #

Generic (ModulePragma l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ModulePragma l) :: Type -> Type #

Methods

from :: ModulePragma l -> Rep (ModulePragma l) x #

to :: Rep (ModulePragma l) x -> ModulePragma l #

Generic (Overlap l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Overlap l) :: Type -> Type #

Methods

from :: Overlap l -> Rep (Overlap l) x #

to :: Rep (Overlap l) x -> Overlap l #

Generic (Activation l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Activation l) :: Type -> Type #

Methods

from :: Activation l -> Rep (Activation l) x #

to :: Rep (Activation l) x -> Activation l #

Generic (Rule l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Rule l) :: Type -> Type #

Methods

from :: Rule l -> Rep (Rule l) x #

to :: Rep (Rule l) x -> Rule l #

Generic (RuleVar l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (RuleVar l) :: Type -> Type #

Methods

from :: RuleVar l -> Rep (RuleVar l) x #

to :: Rep (RuleVar l) x -> RuleVar l #

Generic (WarningText l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (WarningText l) :: Type -> Type #

Methods

from :: WarningText l -> Rep (WarningText l) x #

to :: Rep (WarningText l) x -> WarningText l #

Generic (Pat l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Pat l) :: Type -> Type #

Methods

from :: Pat l -> Rep (Pat l) x #

to :: Rep (Pat l) x -> Pat l #

Generic (PXAttr l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (PXAttr l) :: Type -> Type #

Methods

from :: PXAttr l -> Rep (PXAttr l) x #

to :: Rep (PXAttr l) x -> PXAttr l #

Generic (RPatOp l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (RPatOp l) :: Type -> Type #

Methods

from :: RPatOp l -> Rep (RPatOp l) x #

to :: Rep (RPatOp l) x -> RPatOp l #

Generic (RPat l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (RPat l) :: Type -> Type #

Methods

from :: RPat l -> Rep (RPat l) x #

to :: Rep (RPat l) x -> RPat l #

Generic (PatField l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (PatField l) :: Type -> Type #

Methods

from :: PatField l -> Rep (PatField l) x #

to :: Rep (PatField l) x -> PatField l #

Generic (Stmt l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Stmt l) :: Type -> Type #

Methods

from :: Stmt l -> Rep (Stmt l) x #

to :: Rep (Stmt l) x -> Stmt l #

Generic (QualStmt l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (QualStmt l) :: Type -> Type #

Methods

from :: QualStmt l -> Rep (QualStmt l) x #

to :: Rep (QualStmt l) x -> QualStmt l #

Generic (FieldUpdate l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (FieldUpdate l) :: Type -> Type #

Methods

from :: FieldUpdate l -> Rep (FieldUpdate l) x #

to :: Rep (FieldUpdate l) x -> FieldUpdate l #

Generic (Alt l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Alt l) :: Type -> Type #

Methods

from :: Alt l -> Rep (Alt l) x #

to :: Rep (Alt l) x -> Alt l #

Generic (Loc a) 
Instance details

Defined in Language.Haskell.Exts.SrcLoc

Associated Types

type Rep (Loc a) :: Type -> Type #

Methods

from :: Loc a -> Rep (Loc a) x #

to :: Rep (Loc a) x -> Loc a #

Generic (AddrRange a) 
Instance details

Defined in Data.IP.Range

Associated Types

type Rep (AddrRange a) :: Type -> Type #

Methods

from :: AddrRange a -> Rep (AddrRange a) x #

to :: Rep (AddrRange a) x -> AddrRange a #

Generic (Doc a) 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep (Doc a) :: Type -> Type #

Methods

from :: Doc a -> Rep (Doc a) x #

to :: Rep (Doc a) x -> Doc a #

Generic (Db f) Source # 
Instance details

Defined in TsWeb.Tables.Session.Test

Associated Types

type Rep (Db f) :: Type -> Type #

Methods

from :: Db f -> Rep (Db f) x #

to :: Rep (Db f) x -> Db f #

Generic (UsersMixin f) Source # 
Instance details

Defined in TsWeb.Tables.Session.Test

Associated Types

type Rep (UsersMixin f) :: Type -> Type #

Methods

from :: UsersMixin f -> Rep (UsersMixin f) x #

to :: Rep (UsersMixin f) x -> UsersMixin f #

Generic (Either a b) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Either a b) :: Type -> Type #

Methods

from :: Either a b -> Rep (Either a b) x #

to :: Rep (Either a b) x -> Either a b #

Generic (V1 p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (V1 p) :: Type -> Type #

Methods

from :: V1 p -> Rep (V1 p) x #

to :: Rep (V1 p) x -> V1 p #

Generic (U1 p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (U1 p) :: Type -> Type #

Methods

from :: U1 p -> Rep (U1 p) x #

to :: Rep (U1 p) x -> U1 p #

Generic (a, b) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b) :: Type -> Type #

Methods

from :: (a, b) -> Rep (a, b) x #

to :: Rep (a, b) x -> (a, b) #

Generic (Arg a b) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Arg a b) :: Type -> Type #

Methods

from :: Arg a b -> Rep (Arg a b) x #

to :: Rep (Arg a b) x -> Arg a b #

Generic (WrappedMonad m a) 
Instance details

Defined in Control.Applicative

Associated Types

type Rep (WrappedMonad m a) :: Type -> Type #

Methods

from :: WrappedMonad m a -> Rep (WrappedMonad m a) x #

to :: Rep (WrappedMonad m a) x -> WrappedMonad m a #

Generic (Proxy t) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Proxy t) :: Type -> Type #

Methods

from :: Proxy t -> Rep (Proxy t) x #

to :: Rep (Proxy t) x -> Proxy t #

Generic (PrimaryKey (SessionT d) f) Source # 
Instance details

Defined in TsWeb.Tables.Session

Associated Types

type Rep (PrimaryKey (SessionT d) f) :: Type -> Type #

Methods

from :: PrimaryKey (SessionT d) f -> Rep (PrimaryKey (SessionT d) f) x #

to :: Rep (PrimaryKey (SessionT d) f) x -> PrimaryKey (SessionT d) f #

Generic (PgRange n a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Associated Types

type Rep (PgRange n a) :: Type -> Type #

Methods

from :: PgRange n a -> Rep (PgRange n a) x #

to :: Rep (PgRange n a) x -> PgRange n a #

Generic (PgJSONEach valType f) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Associated Types

type Rep (PgJSONEach valType f) :: Type -> Type #

Methods

from :: PgJSONEach valType f -> Rep (PgJSONEach valType f) x #

to :: Rep (PgJSONEach valType f) x -> PgJSONEach valType f #

Generic (PgJSONElement a f) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Associated Types

type Rep (PgJSONElement a f) :: Type -> Type #

Methods

from :: PgJSONElement a f -> Rep (PgJSONElement a f) x #

to :: Rep (PgJSONElement a f) x -> PgJSONElement a f #

Generic (Cofree f a) 
Instance details

Defined in Control.Comonad.Cofree

Associated Types

type Rep (Cofree f a) :: Type -> Type #

Methods

from :: Cofree f a -> Rep (Cofree f a) x #

to :: Rep (Cofree f a) x -> Cofree f a #

Generic (Free f a) 
Instance details

Defined in Control.Monad.Free

Associated Types

type Rep (Free f a) :: Type -> Type #

Methods

from :: Free f a -> Rep (Free f a) x #

to :: Rep (Free f a) x -> Free f a #

Generic (SessionT d f) Source # 
Instance details

Defined in TsWeb.Tables.Session

Associated Types

type Rep (SessionT d f) :: Type -> Type #

Methods

from :: SessionT d f -> Rep (SessionT d f) x #

to :: Rep (SessionT d f) x -> SessionT d f #

Generic (PgUnnestArrayTbl a f) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Associated Types

type Rep (PgUnnestArrayTbl a f) :: Type -> Type #

Methods

from :: PgUnnestArrayTbl a f -> Rep (PgUnnestArrayTbl a f) x #

to :: Rep (PgUnnestArrayTbl a f) x -> PgUnnestArrayTbl a f #

Generic (PgUnnestArrayWithOrdinalityTbl a f) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Associated Types

type Rep (PgUnnestArrayWithOrdinalityTbl a f) :: Type -> Type #

Methods

from :: PgUnnestArrayWithOrdinalityTbl a f -> Rep (PgUnnestArrayWithOrdinalityTbl a f) x #

to :: Rep (PgUnnestArrayWithOrdinalityTbl a f) x -> PgUnnestArrayWithOrdinalityTbl a f #

Generic (Rec1 f p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Rec1 f p) :: Type -> Type #

Methods

from :: Rec1 f p -> Rep (Rec1 f p) x #

to :: Rep (Rec1 f p) x -> Rec1 f p #

Generic (URec (Ptr ()) p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec (Ptr ()) p) :: Type -> Type #

Methods

from :: URec (Ptr ()) p -> Rep (URec (Ptr ()) p) x #

to :: Rep (URec (Ptr ()) p) x -> URec (Ptr ()) p #

Generic (URec Char p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Char p) :: Type -> Type #

Methods

from :: URec Char p -> Rep (URec Char p) x #

to :: Rep (URec Char p) x -> URec Char p #

Generic (URec Double p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Double p) :: Type -> Type #

Methods

from :: URec Double p -> Rep (URec Double p) x #

to :: Rep (URec Double p) x -> URec Double p #

Generic (URec Float p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Float p) :: Type -> Type #

Methods

from :: URec Float p -> Rep (URec Float p) x #

to :: Rep (URec Float p) x -> URec Float p #

Generic (URec Int p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Int p) :: Type -> Type #

Methods

from :: URec Int p -> Rep (URec Int p) x #

to :: Rep (URec Int p) x -> URec Int p #

Generic (URec Word p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Word p) :: Type -> Type #

Methods

from :: URec Word p -> Rep (URec Word p) x #

to :: Rep (URec Word p) x -> URec Word p #

Generic (a, b, c) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c) :: Type -> Type #

Methods

from :: (a, b, c) -> Rep (a, b, c) x #

to :: Rep (a, b, c) x -> (a, b, c) #

Generic (WrappedArrow a b c) 
Instance details

Defined in Control.Applicative

Associated Types

type Rep (WrappedArrow a b c) :: Type -> Type #

Methods

from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x #

to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c #

Generic (Const a b) 
Instance details

Defined in Data.Functor.Const

Associated Types

type Rep (Const a b) :: Type -> Type #

Methods

from :: Const a b -> Rep (Const a b) x #

to :: Rep (Const a b) x -> Const a b #

Generic (Ap f a) 
Instance details

Defined in Data.Monoid

Associated Types

type Rep (Ap f a) :: Type -> Type #

Methods

from :: Ap f a -> Rep (Ap f a) x #

to :: Rep (Ap f a) x -> Ap f a #

Generic (Alt f a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Alt f a) :: Type -> Type #

Methods

from :: Alt f a -> Rep (Alt f a) x #

to :: Rep (Alt f a) x -> Alt f a #

Generic (Join p a) 
Instance details

Defined in Data.Bifunctor.Join

Associated Types

type Rep (Join p a) :: Type -> Type #

Methods

from :: Join p a -> Rep (Join p a) x #

to :: Rep (Join p a) x -> Join p a #

Generic (FreeF f a b) 
Instance details

Defined in Control.Monad.Trans.Free

Associated Types

type Rep (FreeF f a b) :: Type -> Type #

Methods

from :: FreeF f a b -> Rep (FreeF f a b) x #

to :: Rep (FreeF f a b) x -> FreeF f a b #

Generic (Tagged s b) 
Instance details

Defined in Data.Tagged

Associated Types

type Rep (Tagged s b) :: Type -> Type #

Methods

from :: Tagged s b -> Rep (Tagged s b) x #

to :: Rep (Tagged s b) x -> Tagged s b #

Generic (Vector v n a) 
Instance details

Defined in Data.Vector.Generic.Sized.Internal

Associated Types

type Rep (Vector v n a) :: Type -> Type #

Methods

from :: Vector v n a -> Rep (Vector v n a) x #

to :: Rep (Vector v n a) x -> Vector v n a #

Generic (K1 i c p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (K1 i c p) :: Type -> Type #

Methods

from :: K1 i c p -> Rep (K1 i c p) x #

to :: Rep (K1 i c p) x -> K1 i c p #

Generic ((f :+: g) p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :+: g) p) :: Type -> Type #

Methods

from :: (f :+: g) p -> Rep ((f :+: g) p) x #

to :: Rep ((f :+: g) p) x -> (f :+: g) p #

Generic ((f :*: g) p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :*: g) p) :: Type -> Type #

Methods

from :: (f :*: g) p -> Rep ((f :*: g) p) x #

to :: Rep ((f :*: g) p) x -> (f :*: g) p #

Generic (a, b, c, d) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d) :: Type -> Type #

Methods

from :: (a, b, c, d) -> Rep (a, b, c, d) x #

to :: Rep (a, b, c, d) x -> (a, b, c, d) #

Generic (Product f g a) 
Instance details

Defined in Data.Functor.Product

Associated Types

type Rep (Product f g a) :: Type -> Type #

Methods

from :: Product f g a -> Rep (Product f g a) x #

to :: Rep (Product f g a) x -> Product f g a #

Generic (Sum f g a) 
Instance details

Defined in Data.Functor.Sum

Associated Types

type Rep (Sum f g a) :: Type -> Type #

Methods

from :: Sum f g a -> Rep (Sum f g a) x #

to :: Rep (Sum f g a) x -> Sum f g a #

Generic (MVector v n s a) 
Instance details

Defined in Data.Vector.Generic.Mutable.Sized.Internal

Associated Types

type Rep (MVector v n s a) :: Type -> Type #

Methods

from :: MVector v n s a -> Rep (MVector v n s a) x #

to :: Rep (MVector v n s a) x -> MVector v n s a #

Generic (M1 i c f p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (M1 i c f p) :: Type -> Type #

Methods

from :: M1 i c f p -> Rep (M1 i c f p) x #

to :: Rep (M1 i c f p) x -> M1 i c f p #

Generic ((f :.: g) p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :.: g) p) :: Type -> Type #

Methods

from :: (f :.: g) p -> Rep ((f :.: g) p) x #

to :: Rep ((f :.: g) p) x -> (f :.: g) p #

Generic (a, b, c, d, e) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e) :: Type -> Type #

Methods

from :: (a, b, c, d, e) -> Rep (a, b, c, d, e) x #

to :: Rep (a, b, c, d, e) x -> (a, b, c, d, e) #

Generic (Compose f g a) 
Instance details

Defined in Data.Functor.Compose

Associated Types

type Rep (Compose f g a) :: Type -> Type #

Methods

from :: Compose f g a -> Rep (Compose f g a) x #

to :: Rep (Compose f g a) x -> Compose f g a #

Generic (WrappedBifunctor p a b) 
Instance details

Defined in Data.Bifunctor.Wrapped

Associated Types

type Rep (WrappedBifunctor p a b) :: Type -> Type #

Methods

from :: WrappedBifunctor p a b -> Rep (WrappedBifunctor p a b) x #

to :: Rep (WrappedBifunctor p a b) x -> WrappedBifunctor p a b #

Generic (Joker g a b) 
Instance details

Defined in Data.Bifunctor.Joker

Associated Types

type Rep (Joker g a b) :: Type -> Type #

Methods

from :: Joker g a b -> Rep (Joker g a b) x #

to :: Rep (Joker g a b) x -> Joker g a b #

Generic (Flip p a b) 
Instance details

Defined in Data.Bifunctor.Flip

Associated Types

type Rep (Flip p a b) :: Type -> Type #

Methods

from :: Flip p a b -> Rep (Flip p a b) x #

to :: Rep (Flip p a b) x -> Flip p a b #

Generic (Clown f a b) 
Instance details

Defined in Data.Bifunctor.Clown

Associated Types

type Rep (Clown f a b) :: Type -> Type #

Methods

from :: Clown f a b -> Rep (Clown f a b) x #

to :: Rep (Clown f a b) x -> Clown f a b #

Generic (a, b, c, d, e, f) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f) :: Type -> Type #

Methods

from :: (a, b, c, d, e, f) -> Rep (a, b, c, d, e, f) x #

to :: Rep (a, b, c, d, e, f) x -> (a, b, c, d, e, f) #

Generic (Sum p q a b) 
Instance details

Defined in Data.Bifunctor.Sum

Associated Types

type Rep (Sum p q a b) :: Type -> Type #

Methods

from :: Sum p q a b -> Rep (Sum p q a b) x #

to :: Rep (Sum p q a b) x -> Sum p q a b #

Generic (Product f g a b) 
Instance details

Defined in Data.Bifunctor.Product

Associated Types

type Rep (Product f g a b) :: Type -> Type #

Methods

from :: Product f g a b -> Rep (Product f g a b) x #

to :: Rep (Product f g a b) x -> Product f g a b #

Generic (a, b, c, d, e, f, g) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g) :: Type -> Type #

Methods

from :: (a, b, c, d, e, f, g) -> Rep (a, b, c, d, e, f, g) x #

to :: Rep (a, b, c, d, e, f, g) x -> (a, b, c, d, e, f, g) #

Generic (Tannen f p a b) 
Instance details

Defined in Data.Bifunctor.Tannen

Associated Types

type Rep (Tannen f p a b) :: Type -> Type #

Methods

from :: Tannen f p a b -> Rep (Tannen f p a b) x #

to :: Rep (Tannen f p a b) x -> Tannen f p a b #

Generic (Biff p f g a b) 
Instance details

Defined in Data.Bifunctor.Biff

Associated Types

type Rep (Biff p f g a b) :: Type -> Type #

Methods

from :: Biff p f g a b -> Rep (Biff p f g a b) x #

to :: Rep (Biff p f g a b) x -> Biff p f g a b #

class Monad m => MonadIO (m :: Type -> Type) where #

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Methods

liftIO :: IO a -> m a #

Lift a computation from the IO monad.

Instances
MonadIO IO

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.IO.Class

Methods

liftIO :: IO a -> IO a #

MonadIO Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

liftIO :: IO a -> Q a #

MonadIO Pg 
Instance details

Defined in Database.Beam.Postgres.Connection

Methods

liftIO :: IO a -> Pg a #

MonadIO SqlSyntaxM 
Instance details

Defined in Database.Beam.Backend.SQL.Builder

Methods

liftIO :: IO a -> SqlSyntaxM a #

MonadIO m => MonadIO (ResourceT m) 
Instance details

Defined in Control.Monad.Trans.Resource.Internal

Methods

liftIO :: IO a -> ResourceT m a #

MonadIO m => MonadIO (ListT m) 
Instance details

Defined in ListT

Methods

liftIO :: IO a -> ListT m a #

MonadIO m => MonadIO (ActionCtxT ctx m) 
Instance details

Defined in Web.Spock.Internal.Wire

Methods

liftIO :: IO a -> ActionCtxT ctx m a #

MonadIO m => MonadIO (SpockCtxT ctx m) 
Instance details

Defined in Web.Spock.Core

Methods

liftIO :: IO a -> SpockCtxT ctx m a #

(Monoid w, MonadIO m) => MonadIO (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

liftIO :: IO a -> WriterT w m a #

MonadIO m => MonadIO (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

liftIO :: IO a -> StateT s m a #

(Functor f, MonadIO m) => MonadIO (FreeT f m) 
Instance details

Defined in Control.Monad.Trans.Free

Methods

liftIO :: IO a -> FreeT f m a #

(Error e, MonadIO m) => MonadIO (ErrorT e m) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

liftIO :: IO a -> ErrorT e m a #

MonadIO m => MonadIO (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

liftIO :: IO a -> ReaderT r m a #

MonadIO m => MonadIO (WebStateT conn sess st m) 
Instance details

Defined in Web.Spock.Internal.Types

Methods

liftIO :: IO a -> WebStateT conn sess st m a #

data Identity a #

Identity functor and monad. (a non-strict monad)

Since: base-4.8.0.0

Instances
Monad Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(>>=) :: Identity a -> (a -> Identity b) -> Identity b #

(>>) :: Identity a -> Identity b -> Identity b #

return :: a -> Identity a #

fail :: String -> Identity a #

Functor Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fmap :: (a -> b) -> Identity a -> Identity b #

(<$) :: a -> Identity b -> Identity a #

MonadFix Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

mfix :: (a -> Identity a) -> Identity a #

Applicative Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

pure :: a -> Identity a #

(<*>) :: Identity (a -> b) -> Identity a -> Identity b #

liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c #

(*>) :: Identity a -> Identity b -> Identity b #

(<*) :: Identity a -> Identity b -> Identity a #

Foldable Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fold :: Monoid m => Identity m -> m #

foldMap :: Monoid m => (a -> m) -> Identity a -> m #

foldr :: (a -> b -> b) -> b -> Identity a -> b #

foldr' :: (a -> b -> b) -> b -> Identity a -> b #

foldl :: (b -> a -> b) -> b -> Identity a -> b #

foldl' :: (b -> a -> b) -> b -> Identity a -> b #

foldr1 :: (a -> a -> a) -> Identity a -> a #

foldl1 :: (a -> a -> a) -> Identity a -> a #

toList :: Identity a -> [a] #

null :: Identity a -> Bool #

length :: Identity a -> Int #

elem :: Eq a => a -> Identity a -> Bool #

maximum :: Ord a => Identity a -> a #

minimum :: Ord a => Identity a -> a #

sum :: Num a => Identity a -> a #

product :: Num a => Identity a -> a #

Traversable Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) #

sequenceA :: Applicative f => Identity (f a) -> f (Identity a) #

mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) #

sequence :: Monad m => Identity (m a) -> m (Identity a) #

Representable Identity 
Instance details

Defined in Data.Functor.Rep

Associated Types

type Rep Identity :: Type #

Methods

tabulate :: (Rep Identity -> a) -> Identity a #

index :: Identity a -> Rep Identity -> a #

Eq1 Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Identity a -> Identity b -> Bool #

Ord1 Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Identity a -> Identity b -> Ordering #

Read1 Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Identity a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Identity a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Identity a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Identity a] #

Show1 Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Identity a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Identity a] -> ShowS #

UserData Users Source # 
Instance details

Defined in TsWeb.Tables.Session.Test

MonadBaseControl Identity Identity 
Instance details

Defined in Control.Monad.Trans.Control

Associated Types

type StM Identity a :: Type #

(BeamBackend be, Generic (tbl Identity), Generic (tbl Exposed), GFromBackendRow be (Rep (tbl Exposed)) (Rep (tbl Identity))) => FromBackendRow be (tbl Identity) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

(BeamBackend be, Generic (tbl (Nullable Identity)), Generic (tbl (Nullable Exposed)), GFromBackendRow be (Rep (tbl (Nullable Exposed))) (Rep (tbl (Nullable Identity)))) => FromBackendRow be (tbl (Nullable Identity)) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

FromBackendRow be (t Identity) => GFromBackendRow be (K1 R (t Exposed) :: Type -> Type) (K1 R (t Identity) :: Type -> Type) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

Methods

gFromBackendRow :: Proxy (K1 R (t Exposed)) -> FromBackendRowM be (K1 R (t Identity) ())

gValuesNeeded :: Proxy be -> Proxy (K1 R (t Exposed)) -> Proxy (K1 R (t Identity)) -> Int

FromBackendRow be (t (Nullable Identity)) => GFromBackendRow be (K1 R (t (Nullable Exposed)) :: Type -> Type) (K1 R (t (Nullable Identity)) :: Type -> Type) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

FieldsFulfillConstraintNullable c t => GFieldsFulfillConstraint c (K1 R (t (Nullable Exposed)) :: Type -> Type) (K1 R (t (Nullable Identity)) :: Type -> Type) (K1 R (t (Nullable (WithConstraint c))) :: Type -> Type) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

gWithConstrainedFields :: Proxy c -> Proxy (K1 R (t (Nullable Exposed))) -> K1 R (t (Nullable Identity)) () -> K1 R (t (Nullable (WithConstraint c))) () #

FieldsFulfillConstraint c t => GFieldsFulfillConstraint c (K1 R (t Exposed) :: Type -> Type) (K1 R (t Identity) :: Type -> Type) (K1 R (t (WithConstraint c)) :: Type -> Type) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

gWithConstrainedFields :: Proxy c -> Proxy (K1 R (t Exposed)) -> K1 R (t Identity) () -> K1 R (t (WithConstraint c)) () #

Bounded a => Bounded (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Enum a => Enum (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Eq a => Eq (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(==) :: Identity a -> Identity a -> Bool #

(/=) :: Identity a -> Identity a -> Bool #

Floating a => Floating (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Fractional a => Fractional (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Integral a => Integral (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Num a => Num (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Ord a => Ord (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

compare :: Identity a -> Identity a -> Ordering #

(<) :: Identity a -> Identity a -> Bool #

(<=) :: Identity a -> Identity a -> Bool #

(>) :: Identity a -> Identity a -> Bool #

(>=) :: Identity a -> Identity a -> Bool #

max :: Identity a -> Identity a -> Identity a #

min :: Identity a -> Identity a -> Identity a #

Read a => Read (Identity a)

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Real a => Real (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

toRational :: Identity a -> Rational #

RealFloat a => RealFloat (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

RealFrac a => RealFrac (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

properFraction :: Integral b => Identity a -> (b, Identity a) #

truncate :: Integral b => Identity a -> b #

round :: Integral b => Identity a -> b #

ceiling :: Integral b => Identity a -> b #

floor :: Integral b => Identity a -> b #

Show a => Show (Identity a)

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

showsPrec :: Int -> Identity a -> ShowS #

show :: Identity a -> String #

showList :: [Identity a] -> ShowS #

Ix a => Ix (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

IsString a => IsString (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.String

Methods

fromString :: String -> Identity a #

Generic (Identity a) 
Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep (Identity a) :: Type -> Type #

Methods

from :: Identity a -> Rep (Identity a) x #

to :: Rep (Identity a) x -> Identity a #

Semigroup a => Semigroup (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(<>) :: Identity a -> Identity a -> Identity a #

sconcat :: NonEmpty (Identity a) -> Identity a #

stimes :: Integral b => b -> Identity a -> Identity a #

Monoid a => Monoid (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

mempty :: Identity a #

mappend :: Identity a -> Identity a -> Identity a #

mconcat :: [Identity a] -> Identity a #

Storable a => Storable (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

sizeOf :: Identity a -> Int #

alignment :: Identity a -> Int #

peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) #

pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Identity a) #

pokeByteOff :: Ptr b -> Int -> Identity a -> IO () #

peek :: Ptr (Identity a) -> IO (Identity a) #

poke :: Ptr (Identity a) -> Identity a -> IO () #

Bits a => Bits (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

FiniteBits a => FiniteBits (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Generic1 Identity 
Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep1 Identity :: k -> Type #

Methods

from1 :: Identity a -> Rep1 Identity a #

to1 :: Rep1 Identity a -> Identity a #

Table t => SqlJustable (t Identity) (t (Nullable Identity)) 
Instance details

Defined in Database.Beam.Query.Combinators

Eq (PrimaryKey (SessionT d) Identity) Source # 
Instance details

Defined in TsWeb.Tables.Session

Eq (d Identity) => Eq (SessionT d Identity) Source # 
Instance details

Defined in TsWeb.Tables.Session

Ord (PrimaryKey (SessionT d) Identity) Source # 
Instance details

Defined in TsWeb.Tables.Session

Ord (d Identity) => Ord (SessionT d Identity) Source # 
Instance details

Defined in TsWeb.Tables.Session

Show (PrimaryKey (SessionT d) Identity) Source # 
Instance details

Defined in TsWeb.Tables.Session

Show (d Identity) => Show (SessionT d Identity) Source # 
Instance details

Defined in TsWeb.Tables.Session

Table t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity)) 
Instance details

Defined in Database.Beam.Query.Combinators

type Rep Identity 
Instance details

Defined in Data.Functor.Rep

type Rep Identity = ()
type StM Identity a 
Instance details

Defined in Control.Monad.Trans.Control

type StM Identity a = a
type Rep (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

type Rep (Identity a) = D1 (MetaData "Identity" "Data.Functor.Identity" "base" True) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just "runIdentity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

type Rep1 Identity = D1 (MetaData "Identity" "Data.Functor.Identity" "base" True) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just "runIdentity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

runDelete :: (BeamSqlBackend be, MonadBeam be m) => SqlDelete be table -> m () #

Run a SqlDelete in a MonadBeam

delete #

Arguments

:: BeamSqlBackend be 
=> DatabaseEntity be db (TableEntity table)

Table to delete from

-> (forall s. (forall s'. table (QExpr be s')) -> QExpr be s Bool)

Build a WHERE clause given a table containing expressions

-> SqlDelete be table 

Build a SqlDelete from a table and a way to build a WHERE clause

runUpdate :: (BeamSqlBackend be, MonadBeam be m) => SqlUpdate be tbl -> m () #

Run a SqlUpdate in a MonadBeam.

save #

Arguments

:: (Table table, BeamSqlBackend be, SqlValableTable be (PrimaryKey table), SqlValableTable be table, HasTableEquality be (PrimaryKey table)) 
=> DatabaseEntity be db (TableEntity table)

Table to update

-> table Identity

Value to set to

-> SqlUpdate be table 

Generate a SqlUpdate that will update the given table row with the given value.

The SQL UPDATE that is generated will set every non-primary key field for the row where each primary key field is exactly what is given.

Note: This is a pure SQL UPDATE command. This does not upsert or merge values.

toUpdatedValueMaybe :: (forall s. table (QExpr be s) -> Maybe (QExpr be s a)) -> QFieldAssignment be table a #

Use with set to optionally set a fiield to a new value, calculated based on one or more fields from the existing row

toUpdatedValue :: (forall s. table (QExpr be s) -> QExpr be s a) -> QFieldAssignment be table a #

Use with set to set a field to a new value that is calculated based on one or more fields from the existing row

toOldValue :: QFieldAssignment be table a #

Use with set to not modify the field

toNewValue :: (forall s. QExpr be s a) -> QFieldAssignment be table a #

Use with set to set a field to an explicit new value that does not depend on any other value

setFieldsTo :: Table table => (forall s. table (QExpr be s)) -> table (QFieldAssignment be table') #

set :: Beamable table => table (QFieldAssignment be table') #

updateTableRow #

Arguments

:: (BeamSqlBackend be, Table table, HasTableEquality be (PrimaryKey table), SqlValableTable be (PrimaryKey table)) 
=> DatabaseEntity be db (TableEntity table)

The table to update

-> table Identity

The row to update

-> table (QFieldAssignment be table)

Updates to be made (use set to construct an empty field)

-> SqlUpdate be table 

Convenience form of updateTable that generates a WHERE clause that matches only the already existing entity

updateTable #

Arguments

:: (BeamSqlBackend be, Beamable table) 
=> DatabaseEntity be db (TableEntity table)

The table to update

-> table (QFieldAssignment be table)

Updates to be made (use set to construct an empty field)

-> (forall s. table (QExpr be s) -> QExpr be s Bool) 
-> SqlUpdate be table 

A specialization of update that is more convenient for normal tables.

updateRow #

Arguments

:: (BeamSqlBackend be, Table table, HasTableEquality be (PrimaryKey table), SqlValableTable be (PrimaryKey table)) 
=> DatabaseEntity be db (TableEntity table)

The table to insert into

-> table Identity

The row to update

-> (forall s. table (QField s) -> QAssignment be s)

A sequence of assignments to make.

-> SqlUpdate be table 

A specialization of update that matches the given (already existing) row

update #

Arguments

:: (BeamSqlBackend be, Beamable table) 
=> DatabaseEntity be db (TableEntity table)

The table to insert into

-> (forall s. table (QField s) -> QAssignment be s)

A sequence of assignments to make.

-> (forall s. table (QExpr be s) -> QExpr be s Bool)

Build a WHERE clause given a table containing expressions

-> SqlUpdate be table 

Build a SqlUpdate given a table, a list of assignments, and a way to build a WHERE clause.

See the '(<-.)' operator for ways to build assignments. The argument to the second argument is a the table parameterized over QField, which represents the left hand side of assignments. Sometimes, you'd like to also get the current value of a particular column. You can use the current_ function to convert a QField to a QGenExpr.

insertFrom :: (BeamSqlBackend be, HasQBuilder be, Projectible be r) => Q be db QBaseScope r -> SqlInsertValues be r #

Build a SqlInsertValues from a SqlSelect that returns the same table

insertData :: (Projectible be r, BeamSqlBackend be) => [r] -> SqlInsertValues be r #

Build a SqlInsertValues from arbitrarily shaped data containing expressions

insertValues :: (BeamSqlBackend be, Beamable table, FieldsFulfillConstraint (BeamSqlBackendCanSerialize be) table) => [table Identity] -> SqlInsertValues be (table (QExpr be s)) #

Build a SqlInsertValues from concrete table values

insertExpressions :: (BeamSqlBackend be, Beamable table) => (forall s'. [table (QExpr be s')]) -> SqlInsertValues be (table (QExpr be s)) #

Build a SqlInsertValues from series of expressions in tables

runInsert :: (BeamSqlBackend be, MonadBeam be m) => SqlInsert be table -> m () #

Run a SqlInsert in a MonadBeam

insert #

Arguments

:: (BeamSqlBackend be, ProjectibleWithPredicate AnyType () Text (table (QField s))) 
=> DatabaseEntity be db (TableEntity table)

Table to insert into

-> SqlInsertValues be (table (QExpr be s))

Values to insert. See insertValues, insertExpressions, and insertFrom for possibilities.

-> SqlInsert be table 

Generate a SqlInsert given a table and a source of values.

insertOnly #

Arguments

:: (BeamSqlBackend be, ProjectibleWithPredicate AnyType () Text (QExprToField r)) 
=> DatabaseEntity be db (TableEntity table)

Table to insert into

-> (table (QField s) -> QExprToField r) 
-> SqlInsertValues be r

Values to insert. See insertValues, insertExpressions, insertData, and insertFrom for possibilities.

-> SqlInsert be table 

Generate a SqlInsert over only certain fields of a table

dumpSqlSelect :: Projectible (MockSqlBackend SqlSyntaxBuilder) res => Q (MockSqlBackend SqlSyntaxBuilder) db QBaseScope res -> IO () #

Use a special debug syntax to print out an ANSI Standard SELECT statement that may be generated for a given Q.

lookup_ :: (Database be db, Table table, BeamSqlBackend be, HasQBuilder be, SqlValableTable be (PrimaryKey table), HasTableEquality be (PrimaryKey table)) => DatabaseEntity be db (TableEntity table) -> PrimaryKey table Identity -> SqlSelect be (table Identity) #

Convenience function to generate a SqlSelect that looks up a table row given a primary key.

selectWith :: (BeamSqlBackend be, BeamSql99CommonTableExpressionBackend be, HasQBuilder be, Projectible be res) => With be db (Q be db QBaseScope res) -> SqlSelect be (QExprToIdentity res) #

Create a SqlSelect for a query which may have common table expressions. See the documentation of With for more details.

select :: (BeamSqlBackend be, HasQBuilder be, Projectible be res) => Q be db QBaseScope res -> SqlSelect be (QExprToIdentity res) #

Build a SqlSelect for the given Q.

type QGenExprTable ctxt be s (tbl :: (Type -> Type) -> Type) = tbl (QGenExpr ctxt be s) #

A version of the table where each field is a QGenExpr

type QExprTable be s (tbl :: (Type -> Type) -> Type) = QGenExprTable QValueContext be s tbl #

newtype SqlSelect be a #

Represents a select statement in the given backend, returning rows of type a.

data SqlInsert be (table :: (Type -> Type) -> Type) #

Represents a SQL INSERT command that has not yet been run

data SqlInsertValues be proj #

Represents a source of values that can be inserted into a table shaped like tbl.

data SqlUpdate be (table :: (Type -> Type) -> Type) #

Represents a SQL UPDATE statement for the given table.

data SqlDelete be (table :: (Type -> Type) -> Type) #

Represents a SQL DELETE statement for the given table

regrSXY_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

regrSYY_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

regrSXX_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

regrAvgX_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

regrAvgY_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

regrRSquared_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

regrCount_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

regrIntercept_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

regrSlope_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

corr_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

covarSamp_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

covarPop_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QExpr be s a -> QExpr be s b #

varSamp_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QAgg be s b #

varPop_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QAgg be s b #

stddevSamp_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QAgg be s b #

stddevPop_ :: (Num a, Floating b, BeamSqlBackend be, BeamSqlT621Backend be) => QExpr be s a -> QAgg be s b #

(**.) :: (Floating a, BeamSqlBackend be, BeamSqlT621Backend be) => QGenExpr ctxt be s a -> QGenExpr ctxt be s a -> QGenExpr ctxt be s a infixr 8 #

floor_ :: (RealFrac a, Integral b, BeamSqlBackend be, BeamSqlT621Backend be) => QGenExpr ctxt be s a -> QGenExpr ctxt be s b #

ceiling_ :: (RealFrac a, Integral b, BeamSqlBackend be, BeamSqlT621Backend be) => QGenExpr ctxt be s a -> QGenExpr ctxt be s b #

sqrt_ :: (Floating a, BeamSqlBackend be, BeamSqlT621Backend be) => QGenExpr ctxt be s a -> QGenExpr ctxt be s a #

exp_ :: (Floating a, BeamSqlBackend be, BeamSqlT621Backend be) => QGenExpr ctxt be s a -> QGenExpr ctxt be s a #

ln_ :: (Floating a, BeamSqlBackend be, BeamSqlT621Backend be) => QGenExpr ctxt be s a -> QGenExpr ctxt be s a #

nthValue_ :: (BeamSqlBackend be, BeamSqlT618Backend be) => QExpr be s a -> QExpr be s Int -> QAgg be s a #

lastValue_ :: (BeamSqlBackend be, BeamSqlT616Backend be) => QExpr be s a -> QAgg be s a #

firstValue_ :: (BeamSqlBackend be, BeamSqlT616Backend be) => QExpr be s a -> QAgg be s a #

lagWithDefault_ :: (BeamSqlBackend be, BeamSqlT615Backend be) => QExpr be s a -> QExpr be s Int -> QExpr be s a -> QAgg be s a #

leadWithDefault_ :: (BeamSqlBackend be, BeamSqlT615Backend be) => QExpr be s a -> QExpr be s Int -> QExpr be s a -> QAgg be s a #

lag_ :: (BeamSqlBackend be, BeamSqlT615Backend be) => QExpr be s a -> QExpr be s Int -> QAgg be s a #

lead_ :: (BeamSqlBackend be, BeamSqlT615Backend be) => QExpr be s a -> QExpr be s Int -> QAgg be s a #

lag1_ :: (BeamSqlBackend be, BeamSqlT615Backend be) => QExpr be s a -> QAgg be s a #

lead1_ :: (BeamSqlBackend be, BeamSqlT615Backend be) => QExpr be s a -> QAgg be s a #

ntile_ :: (BeamSqlBackend be, BeamSqlT614Backend be) => QExpr be s Int -> QAgg be s a #

any_ :: BeamSql99AggregationBackend be => QExpr be s SqlBool -> QAgg be s SqlBool #

SQL99 ANY(ALL ..) function (but without the explicit ALL)

some_ :: BeamSql99AggregationBackend be => QExpr be s SqlBool -> QAgg be s SqlBool #

SQL99 SOME(ALL ..) function (but without the explicit ALL)

every_ :: BeamSql99AggregationBackend be => QExpr be s SqlBool -> QAgg be s SqlBool #

SQL99 EVERY(ALL ..) function (but without the explicit ALL)

filterWhere_' :: BeamSqlT611Backend be => QAgg be s a -> QExpr be s SqlBool -> QAgg be s a #

Like filterWhere_ but accepting SqlBool.

filterWhere_ :: BeamSqlT611Backend be => QAgg be s a -> QExpr be s Bool -> QAgg be s a #

Support for FILTER (WHERE ...) syntax for aggregates. Part of SQL2003 Elementary OLAP operations feature (T611).

See filterWhere_' for a version that accepts SqlBool.

anyOver_ :: BeamSql99AggregationBackend be => Maybe (BeamSqlBackendAggregationQuantifierSyntax be) -> QExpr be s SqlBool -> QAgg be s SqlBool #

SQL EVERY, SOME, and ANY aggregates. Operates over SqlBool only, as the result can be NULL, even if all inputs are known (no input rows).

someOver_ :: BeamSql99AggregationBackend be => Maybe (BeamSqlBackendAggregationQuantifierSyntax be) -> QExpr be s SqlBool -> QAgg be s SqlBool #

SQL EVERY, SOME, and ANY aggregates. Operates over SqlBool only, as the result can be NULL, even if all inputs are known (no input rows).

everyOver_ :: BeamSql99AggregationBackend be => Maybe (BeamSqlBackendAggregationQuantifierSyntax be) -> QExpr be s SqlBool -> QAgg be s SqlBool #

SQL EVERY, SOME, and ANY aggregates. Operates over SqlBool only, as the result can be NULL, even if all inputs are known (no input rows).

rank_ :: BeamSqlT611Backend be => QAgg be s Int #

SQL2003 RANK function (Requires T611 Elementary OLAP operations support)

rowNumber_ :: BeamSql2003ExpressionBackend be => QAgg be s Int #

SQL2003 ROW_NUMBER function

denseRank_ :: BeamSqlT612Backend be => QAgg be s Int #

SQL2003 DENSE_RANK function (Requires T612 Advanced OLAP operations support)

percentRank_ :: BeamSqlT612Backend be => QAgg be s Double #

SQL2003 PERCENT_RANK function (Requires T612 Advanced OLAP operations support)

cumeDist_ :: BeamSqlT612Backend be => QAgg be s Double #

SQL2003 CUME_DIST function (Requires T612 Advanced OLAP operations support)

count_ :: (BeamSqlBackend be, Integral b) => QExpr be s a -> QAgg be s b #

SQL COUNT(ALL ..) function (but without the explicit ALL)

countAll_ :: BeamSqlBackend be => QAgg be s Int #

SQL COUNT(*) function

sum_ :: (BeamSqlBackend be, Num a) => QExpr be s a -> QAgg be s (Maybe a) #

SQL SUM(ALL ..) function (but without the explicit ALL)

avg_ :: (BeamSqlBackend be, Num a) => QExpr be s a -> QAgg be s (Maybe a) #

SQL AVG(ALL ..) function (but without the explicit ALL)

max_ :: BeamSqlBackend be => QExpr be s a -> QAgg be s (Maybe a) #

SQL MAX(ALL ..) function (but without the explicit ALL)

min_ :: BeamSqlBackend be => QExpr be s a -> QAgg be s (Maybe a) #

SQL MIN(ALL ..) function (but without the explicit ALL)

allInGroupExplicitly_ :: IsSql92AggregationSetQuantifierSyntax s => Maybe s #

Compute an aggregate over all values in a group. Corresponds to the AGG(ALL ..) syntax. Note that ALL is the default for most aggregations, so you don't normally explicitly specify ALL. However, if you need to, you can use this function. To be explicit about quantification in the beam query DSL, but not produce an explicit ALL, use allInGroup_. allInGroup_ has the same semantic meaning, but does not produce an explicit ALL.

distinctInGroup_ :: IsSql92AggregationSetQuantifierSyntax s => Maybe s #

Compute an aggregate only over distinct values in a group. Corresponds to the AGG(DISTINCT ..) syntax.

allInGroup_ :: IsSql92AggregationSetQuantifierSyntax s => Maybe s #

Compute an aggregate over all values in a group. Corresponds semantically to the AGG(ALL ..) syntax, but doesn't produce an explicit ALL. To produce ALL expicitly, see allInGroupExplicitly_.

aggregate_ #

Arguments

:: (BeamSqlBackend be, Aggregable be a, Projectible be r, Projectible be a, ContextRewritable a, ThreadRewritable (QNested s) (WithRewrittenContext a QValueContext)) 
=> (r -> a)

Aggregate projection

-> Q be db (QNested s) r

Query to aggregate over

-> Q be db s (WithRewrittenThread (QNested s) s (WithRewrittenContext a QValueContext)) 

Compute an aggregate over a query.

The supplied aggregate projection should return an aggregate expression (an expression containing an aggregate function such as count_, sum_, countAll_, etc), a grouping key (specified with the group_ function), or a combination of tuples of the above.

Appropriate instances are provided up to 8-tuples.

Semantically, all grouping expressions in the projection will be added to a SQL GROUP BY clause and all aggregate expressions will be computed.

The return value will be the type of the aggregate projection, but transformed to be in the normal value context (i.e., everything will become QGenExprs).

For usage examples, see the manual.

class QGroupable expr grouped | expr -> grouped, grouped -> expr where #

Type class for grouping keys. expr is the type of the grouping key after projection. grouped is the type of the grouping key in the aggregate expression (usually something that contains QGenExprs in the QGroupingContext).

Methods

group_ :: expr -> grouped #

Instances
Beamable tbl => QGroupable (tbl (QExpr be s)) (tbl (QGroupExpr be s))

group_ for any Beamable type. Adds every field in the type to the grouping key. This is the equivalent of including the grouping expression of each field in the type as part of the aggregate projection

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: tbl (QExpr be s) -> tbl (QGroupExpr be s) #

Beamable tbl => QGroupable (tbl (Nullable (QExpr be s))) (tbl (Nullable (QGroupExpr be s)))

group_ for any Beamable type. Adds every field in the type to the grouping key. This is the equivalent of including the grouping expression of each field in the type as part of the aggregate projection

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: tbl (Nullable (QExpr be s)) -> tbl (Nullable (QGroupExpr be s)) #

QGroupable (QExpr be s a) (QGroupExpr be s a)

group_ for simple value expressions.

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: QExpr be s a -> QGroupExpr be s a #

manyToManyPassthrough_ :: (Database be db, Table joinThrough, Table left, Table right, BeamSqlBackend be, SqlEq (QExpr be s) (PrimaryKey left (QExpr be s)), SqlEq (QExpr be s) (PrimaryKey right (QExpr be s))) => DatabaseEntity be db (TableEntity joinThrough) -> (joinThrough (QExpr be s) -> PrimaryKey left (QExpr be s)) -> (joinThrough (QExpr be s) -> PrimaryKey right (QExpr be s)) -> Q be db s (left (QExpr be s)) -> Q be db s (right (QExpr be s)) -> Q be db s (joinThrough (QExpr be s), left (QExpr be s), right (QExpr be s)) #

Used to define many-to-many relationships with additional data. Takes the join table and two key extraction functions from that table to the related tables. Also takes two Qs representing the table sources to relate.

See the manual for more indformation.

manyToMany_ :: (Database be db, Table joinThrough, Table left, Table right, BeamSqlBackend be, SqlEq (QExpr be s) (PrimaryKey left (QExpr be s)), SqlEq (QExpr be s) (PrimaryKey right (QExpr be s))) => DatabaseEntity be db (TableEntity joinThrough) -> (joinThrough (QExpr be s) -> PrimaryKey left (QExpr be s)) -> (joinThrough (QExpr be s) -> PrimaryKey right (QExpr be s)) -> Q be db s (left (QExpr be s)) -> Q be db s (right (QExpr be s)) -> Q be db s (left (QExpr be s), right (QExpr be s)) #

Used to define many-to-many relationships without any additional data. Takes the join table and two key extraction functions from that table to the related tables. Also takes two Qs representing the table sources to relate.

See the manual for more indformation.

oneToMaybe_ #

Arguments

:: (BeamSqlBackend be, Database be db, Table tbl, Table rel, HasTableEqualityNullable be (PrimaryKey tbl)) 
=> DatabaseEntity be db (TableEntity rel)

Table to fetch

-> (rel (QExpr be s) -> PrimaryKey tbl (Nullable (QExpr be s)))

Foreign key

-> tbl (QExpr be s) 
-> Q be db s (rel (Nullable (QExpr be s))) 

Used to define one-to-many (or one-to-one) relationships with a nullable foreign key. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.

oneToManyOptional_ #

Arguments

:: (BeamSqlBackend be, Database be db, Table tbl, Table rel, HasTableEqualityNullable be (PrimaryKey tbl)) 
=> DatabaseEntity be db (TableEntity rel)

Table to fetch

-> (rel (QExpr be s) -> PrimaryKey tbl (Nullable (QExpr be s)))

Foreign key

-> tbl (QExpr be s) 
-> Q be db s (rel (Nullable (QExpr be s))) 

Used to define one-to-many (or one-to-one) relationships with a nullable foreign key. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.

oneToOne_ #

Arguments

:: (Database be db, BeamSqlBackend be, HasTableEquality be (PrimaryKey tbl), Table tbl, Table rel) 
=> DatabaseEntity be db (TableEntity rel)

Table to fetch (many)

-> (rel (QExpr be s) -> PrimaryKey tbl (QExpr be s))

Foreign key

-> tbl (QExpr be s) 
-> Q be db s (rel (QExpr be s)) 

Used to define one-to-many (or one-to-one) relationships. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.

oneToMany_ #

Arguments

:: (Database be db, BeamSqlBackend be, HasTableEquality be (PrimaryKey tbl), Table tbl, Table rel) 
=> DatabaseEntity be db (TableEntity rel)

Table to fetch (many)

-> (rel (QExpr be s) -> PrimaryKey tbl (QExpr be s))

Foreign key

-> tbl (QExpr be s) 
-> Q be db s (rel (QExpr be s)) 

Used to define one-to-many (or one-to-one) relationships. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.

type OneToOne be (db :: (Type -> Type) -> Type) s (one :: (Type -> Type) -> Type) (many :: (Type -> Type) -> Type) = OneToMany be db s one many #

Synonym of OneToMany. Useful for giving more meaningful types, when the relationship is meant to be one-to-one.

type OneToMany be (db :: (Type -> Type) -> Type) s (one :: (Type -> Type) -> Type) (many :: (Type -> Type) -> Type) = BeamSqlBackend be -> BeamSqlBackendCanSerialize be Bool -> one (QExpr be s) -> Q be db s (many (QExpr be s)) #

Convenience type to declare one-to-many relationships. See the manual section on relationships for more information

type OneToMaybe be (db :: (Type -> Type) -> Type) s (tbl :: (Type -> Type) -> Type) (rel :: (Type -> Type) -> Type) = OneToManyOptional be db s tbl rel #

Synonym of OneToManyOptional. Useful for giving more meaningful types, when the relationship is meant to be one-to-one.

type OneToManyOptional be (db :: (Type -> Type) -> Type) s (tbl :: (Type -> Type) -> Type) (rel :: (Type -> Type) -> Type) = BeamSqlBackend be -> BeamSqlBackendCanSerialize be Bool -> BeamSqlBackendCanSerialize be SqlNull -> tbl (QExpr be s) -> Q be db s (rel (Nullable (QExpr be s))) #

Convenience type to declare one-to-many relationships with a nullable foreign key. See the manual section on relationships for more information

type ManyToMany be (db :: (Type -> Type) -> Type) (left :: (Type -> Type) -> Type) (right :: (Type -> Type) -> Type) = forall s. (BeamSqlBackend be, SqlEq (QExpr be s) (PrimaryKey left (QExpr be s)), SqlEq (QExpr be s) (PrimaryKey right (QExpr be s))) => Q be db s (left (QExpr be s)) -> Q be db s (right (QExpr be s)) -> Q be db s (left (QExpr be s), right (QExpr be s)) #

Convenience type to declare many-to-many relationships. See the manual section on relationships for more information

type ManyToManyThrough be (db :: (Type -> Type) -> Type) (through :: (Type -> Type) -> Type) (left :: (Type -> Type) -> Type) (right :: (Type -> Type) -> Type) = forall s. (BeamSqlBackend be, SqlEq (QExpr be s) (PrimaryKey left (QExpr be s)), SqlEq (QExpr be s) (PrimaryKey right (QExpr be s))) => Q be db s (left (QExpr be s)) -> Q be db s (right (QExpr be s)) -> Q be db s (through (QExpr be s), left (QExpr be s), right (QExpr be s)) #

Convenience type to declare many-to-many relationships with additional data. See the manual section on relationships for more information

(<|>.) :: (SqlJustable a (QGenExpr ctxt syntax s y), SqlDeconstructMaybe syntax (QGenExpr ctxt syntax s y) a s) => QGenExpr ctxt syntax s y -> QGenExpr ctxt syntax s y -> QGenExpr ctxt syntax s y infixl 3 #

fromMaybe_ :: BeamSqlBackend be => QGenExpr ctxt be s a -> QGenExpr ctxt be s (Maybe a) -> QGenExpr ctxt be s a #

Converta a Maybe value to a concrete value, by suppling a default

coalesce_ :: BeamSqlBackend be => [QGenExpr ctxt be s (Maybe a)] -> QGenExpr ctxt be s a -> QGenExpr ctxt be s a #

SQL COALESCE support

if_ :: BeamSqlBackend be => [QIfCond context be s a] -> QIfElse context be s a -> QGenExpr context be s a #

else_ :: QGenExpr context be s a -> QIfElse context be s a #

then_' :: QGenExpr context be s SqlBool -> QGenExpr context be s a -> QIfCond context be s a #

then_ :: QGenExpr context be s Bool -> QGenExpr context be s a -> QIfCond context be s a #

desc_ :: BeamSqlBackend be => QExpr be s a -> QOrd be s a #

Produce a QOrd corresponding to a SQL DESC ordering

asc_ :: BeamSqlBackend be => QExpr be s a -> QOrd be s a #

Produce a QOrd corresponding to a SQL ASC ordering

orderBy_ :: (Projectible be a, SqlOrderable be ordering, ThreadRewritable (QNested s) a) => (a -> ordering) -> Q be db (QNested s) a -> Q be db s (WithRewrittenThread (QNested s) s a) #

Order by the given expressions. The return type of the ordering key should either be the result of asc_ or desc_ (or another ordering QOrd generated by a backend-specific ordering) or an (possibly nested) tuple of results of the former.

The manual section has more information.

withWindow_ #

Arguments

:: (ProjectibleWithPredicate WindowFrameContext be (WithExprContext (BeamSqlBackendWindowFrameSyntax' be)) window, Projectible be r, Projectible be a, ContextRewritable a, ThreadRewritable (QNested s) (WithRewrittenContext a QValueContext)) 
=> (r -> window)

Window builder function

-> (r -> window -> a)

Projection builder function. Has access to the windows generated above

-> Q be db (QNested s) r

Query to window over

-> Q be db s (WithRewrittenThread (QNested s) s (WithRewrittenContext a QValueContext)) 

Compute a query over windows.

The first function builds window frames using the frame_, partitionBy_, etc functions. The return type can be a single frame, tuples of frame, or any arbitrarily nested tuple of the above. Instances up to 8-tuples are provided.

The second function builds the resulting projection using the result of the subquery as well as the window frames built in the first function. In this function, window expressions can be included in the output using the over_ function.

over_ :: BeamSql2003ExpressionBackend be => QAgg be s a -> QWindow be s -> QWindowExpr be s a #

Produce a window expression given an aggregate function and a window.

frame_ #

Arguments

:: (BeamSql2003ExpressionBackend be, SqlOrderable be ordering, Projectible be partition) 
=> Maybe partition

PARTITION BY

-> Maybe ordering

ORDER BY

-> QFrameBounds be

RANGE / ROWS

-> QWindow be s 

Specify a window frame with all the options

orderPartitionBy_ :: partition -> Maybe partition #

partitionBy_ :: partition -> Maybe partition #

noOrder_ :: Maybe (QOrd be s Int) #

default_ :: BeamSqlBackend be => QGenExpr ctxt be s a #

as_ :: QGenExpr ctxt be s a -> QGenExpr ctxt be s a #

Convenience function that allows you to use type applications to specify the result of a QGenExpr.

Useful to disambiguate the types of QGenExprs without having to provide a complete type signature. As an example, the countAll_ aggregate can return a result of any Integral type. Without further constraints, the type is ambiguous. You can use as_ to disambiguate the return type.

For example, this is ambiguous

aggregate_ (\_ -> countAll_) ..

But this is not

aggregate_ (\_ -> as_ @Int countAll_) ..

exceptAll_ :: (BeamSqlBackend be, Projectible be a, ThreadRewritable (QNested s) a) => Q be db (QNested s) a -> Q be db (QNested s) a -> Q be db s (WithRewrittenThread (QNested s) s a) #

SQL EXCEPT ALL operator

except_ :: (BeamSqlBackend be, Projectible be a, ThreadRewritable (QNested s) a) => Q be db (QNested s) a -> Q be db (QNested s) a -> Q be db s (WithRewrittenThread (QNested s) s a) #

SQL EXCEPT operator

intersectAll_ :: (BeamSqlBackend be, Projectible be a, ThreadRewritable (QNested s) a) => Q be db (QNested s) a -> Q be db (QNested s) a -> Q be db s (WithRewrittenThread (QNested s) s a) #

SQL INTERSECT ALL operator

intersect_ :: (BeamSqlBackend be, Projectible be a, ThreadRewritable (QNested s) a) => Q be db (QNested s) a -> Q be db (QNested s) a -> Q be db s (WithRewrittenThread (QNested s) s a) #

SQL INTERSECT operator

unionAll_ :: (BeamSqlBackend be, Projectible be a, ThreadRewritable (QNested s) a) => Q be db (QNested s) a -> Q be db (QNested s) a -> Q be db s (WithRewrittenThread (QNested s) s a) #

SQL UNION ALL operator

union_ :: (BeamSqlBackend be, Projectible be a, ThreadRewritable (QNested s) a) => Q be db (QNested s) a -> Q be db (QNested s) a -> Q be db s (WithRewrittenThread (QNested s) s a) #

SQL UNION operator

current_ :: BeamSqlBackend be => QField s ty -> QExpr be s ty #

Extract an expression representing the current (non-UPDATEd) value of a QField

trim_ :: (BeamSqlBackendIsString be text, BeamSqlBackend be) => QGenExpr context be s text -> QGenExpr context be s text #

SQL TRIM function

upper_ :: (BeamSqlBackendIsString be text, BeamSqlBackend be) => QGenExpr context be s text -> QGenExpr context be s text #

SQL UPPER function

lower_ :: (BeamSqlBackendIsString be text, BeamSqlBackend be) => QGenExpr context be s text -> QGenExpr context be s text #

SQL LOWER function

position_ :: (BeamSqlBackendIsString be text, BeamSqlBackend be, Integral b) => QExpr be s text -> QExpr be s text -> QExpr be s b #

SQL POSITION(.. IN ..) function

currentTimestamp_ :: BeamSqlBackend be => QGenExpr ctxt be s LocalTime #

SQL CURRENT_TIMESTAMP function

bitLength_ :: BeamSqlBackend be => QGenExpr context be s SqlBitString -> QGenExpr context be s Int #

SQL BIT_LENGTH function

octetLength_ :: (BeamSqlBackend be, BeamSqlBackendIsString be text) => QGenExpr context be s text -> QGenExpr context be s Int #

SQL OCTET_LENGTH function

charLength_ :: (BeamSqlBackend be, BeamSqlBackendIsString be text) => QGenExpr context be s text -> QGenExpr context be s Int #

SQL CHAR_LENGTH function

subquery_ :: (BeamSqlBackend be, HasQBuilder be, Projectible be (QExpr be s a)) => Q be db s (QExpr be s a) -> QGenExpr ctxt be s a #

Project the (presumably) singular result of the given query as an expression

distinct_ :: (BeamSqlBackend be, BeamSql99ExpressionBackend be, HasQBuilder be, Projectible be a) => Q be db s a -> QExpr be s Bool #

Use the SQL99 DISTINCT operator to determine if the given query produces a distinct result

unique_ :: (BeamSqlBackend be, HasQBuilder be, Projectible be a) => Q be db s a -> QExpr be s Bool #

Use the SQL UNIQUE operator to determine if the given query produces a unique result

exists_ :: (BeamSqlBackend be, HasQBuilder be, Projectible be a) => Q be db s a -> QExpr be s Bool #

Use the SQL EXISTS operator to determine if the given query returns any results

offset_ :: (Projectible be a, ThreadRewritable (QNested s) a) => Integer -> Q be db (QNested s) a -> Q be db s (WithRewrittenThread (QNested s) s a) #

Drop the first offset' results.

limit_ :: (Projectible be a, ThreadRewritable (QNested s) a) => Integer -> Q be db (QNested s) a -> Q be db s (WithRewrittenThread (QNested s) s a) #

Limit the number of results returned by a query.

nub_ :: (BeamSqlBackend be, Projectible be r) => Q be db s r -> Q be db s r #

Only return distinct values from a query

references_ :: (Table t, BeamSqlBackend be, HasTableEquality be (PrimaryKey t)) => PrimaryKey t (QGenExpr ctxt be s) -> t (QGenExpr ctxt be s) -> QGenExpr ctxt be s Bool #

Generate an appropriate boolean QGenExpr comparing the given foreign key to the given table. Useful for creating join conditions.

relatedBy_' :: (Database be db, Table rel, BeamSqlBackend be) => DatabaseEntity be db (TableEntity rel) -> (rel (QExpr be s) -> QExpr be s SqlBool) -> Q be db s (rel (QExpr be s)) #

Introduce all entries of the given table which for which the expression (which can depend on the queried table returns true)

relatedBy_ :: (Database be db, Table rel, BeamSqlBackend be) => DatabaseEntity be db (TableEntity rel) -> (rel (QExpr be s) -> QExpr be s Bool) -> Q be db s (rel (QExpr be s)) #

Introduce all entries of the given table which for which the expression (which can depend on the queried table returns true)

related_ :: (Database be db, Table rel, BeamSqlBackend be, HasTableEquality be (PrimaryKey rel)) => DatabaseEntity be db (TableEntity rel) -> PrimaryKey rel (QExpr be s) -> Q be db s (rel (QExpr be s)) #

Introduce all entries of the given table which are referenced by the given PrimaryKey

filter_' :: BeamSqlBackend be => (r -> QExpr be s SqlBool) -> Q be db s r -> Q be db s r #

Synonym for clause >>= x -> guard_' (mkExpr x)>> pure x. Use filter_ for comparisons with Bool

filter_ :: BeamSqlBackend be => (r -> QExpr be s Bool) -> Q be db s r -> Q be db s r #

Synonym for clause >>= x -> guard_ (mkExpr x)>> pure x. Use filter_' for comparisons with SqlBool

guard_' :: BeamSqlBackend be => QExpr be s SqlBool -> Q be db s () #

Only allow results for which the QGenExpr yields TRUE.

This function operates over SqlBool, which are like haskell Bools, except for the special UNKNOWN value that occurs when comparisons include NULL. For a version that operates over known non-NULL booleans, see guard_.

guard_ :: BeamSqlBackend be => QExpr be s Bool -> Q be db s () #

Only allow results for which the QGenExpr yields True. For a version that operates over possibly NULL SqlBools, see guard_'.

subselect_ :: (ThreadRewritable (QNested s) r, Projectible be r) => Q be db (QNested s) r -> Q be db s (WithRewrittenThread (QNested s) s r) #

leftJoin_' :: (BeamSqlBackend be, Projectible be r, ThreadRewritable (QNested s) r, Retaggable (QExpr be s) (WithRewrittenThread (QNested s) s r)) => Q be db (QNested s) r -> (WithRewrittenThread (QNested s) s r -> QExpr be s SqlBool) -> Q be db s (Retag Nullable (WithRewrittenThread (QNested s) s r)) #

Like leftJoin_, but accepts an ON clause returning SqlBool.

leftJoin_ :: (BeamSqlBackend be, Projectible be r, ThreadRewritable (QNested s) r, Retaggable (QExpr be s) (WithRewrittenThread (QNested s) s r)) => Q be db (QNested s) r -> (WithRewrittenThread (QNested s) s r -> QExpr be s Bool) -> Q be db s (Retag Nullable (WithRewrittenThread (QNested s) s r)) #

Introduce a table using a left join. The ON clause is required here.Because this is not an inner join, the resulting table is made nullable. This means that each field that would normally have type 'QExpr x' will now have type 'QExpr (Maybe x)'.

The ON condition given must return Bool. For a version that accepts an ON condition returning SqlBool, see leftJoin_'.

outerJoin_' :: (BeamSqlBackend be, BeamSqlBackendSupportsOuterJoin be, Projectible be a, Projectible be b, ThreadRewritable (QNested s) a, ThreadRewritable (QNested s) b, Retaggable (QExpr be s) (WithRewrittenThread (QNested s) s a), Retaggable (QExpr be s) (WithRewrittenThread (QNested s) s b)) => Q be db (QNested s) a -> Q be db (QNested s) b -> ((WithRewrittenThread (QNested s) s a, WithRewrittenThread (QNested s) s b) -> QExpr be s SqlBool) -> Q be db s (Retag Nullable (WithRewrittenThread (QNested s) s a), Retag Nullable (WithRewrittenThread (QNested s) s b)) #

Like outerJoin_, but accepting SqlBool. Pairs of rows for which the join condition is unknown are considered to be unrelated, by SQL compliant databases at least.

outerJoin_ :: (BeamSqlBackend be, BeamSqlBackendSupportsOuterJoin be, Projectible be a, Projectible be b, ThreadRewritable (QNested s) a, ThreadRewritable (QNested s) b, Retaggable (QExpr be s) (WithRewrittenThread (QNested s) s a), Retaggable (QExpr be s) (WithRewrittenThread (QNested s) s b)) => Q be db (QNested s) a -> Q be db (QNested s) b -> ((WithRewrittenThread (QNested s) s a, WithRewrittenThread (QNested s) s b) -> QExpr be s Bool) -> Q be db s (Retag Nullable (WithRewrittenThread (QNested s) s a), Retag Nullable (WithRewrittenThread (QNested s) s b)) #

Outer join. every row of each table, returning NULL for any row of either table for which the join condition finds no related rows.

This expects a join expression returning Bool, for a version that accepts a SqlBool (a possibly UNKNOWN boolean, that maps more closely to the SQL standard), see outerJoin_'

perhaps_ :: (Projectible be r, BeamSqlBackend be, ThreadRewritable (QNested s) r, Retaggable (QExpr be s) (WithRewrittenThread (QNested s) s r)) => Q be db (QNested s) r -> Q be db s (Retag Nullable (WithRewrittenThread (QNested s) s r)) #

Introduce a table using a left join with no ON clause. Because this is not an inner join, the resulting table is made nullable. This means that each field that would normally have type 'QExpr x' will now have type 'QExpr (Maybe x)'.

join_' :: (Database be db, Table table, BeamSqlBackend be) => DatabaseEntity be db (TableEntity table) -> (table (QExpr be s) -> QExpr be s SqlBool) -> Q be db s (table (QExpr be s)) #

Like join_, but accepting an ON condition that returns SqlBool

join_ :: (Database be db, Table table, BeamSqlBackend be) => DatabaseEntity be db (TableEntity table) -> (table (QExpr be s) -> QExpr be s Bool) -> Q be db s (table (QExpr be s)) #

Introduce all entries of a table into the Q monad based on the given QExpr. The join condition is expected to return a Bool. For a version that takes SqlBool (a possibly UNKNOWN boolean, that maps more closely to the SQL standard), see join_'.

values_ :: (Projectible be a, BeamSqlBackend be) => [a] -> Q be db s a #

allFromView_ :: (Database be db, Beamable table, BeamSqlBackend be) => DatabaseEntity be db (ViewEntity table) -> Q be db s (table (QExpr be s)) #

Introduce all entries of a view into the Q monad

all_ :: (Database be db, BeamSqlBackend be) => DatabaseEntity be db (TableEntity table) -> Q be db s (table (QExpr be s)) #

Introduce all entries of a table into the Q monad

type family HaskellLiteralForQExpr x = (a :: Type) #

Instances
type HaskellLiteralForQExpr (table (QGenExpr context be s)) 
Instance details

Defined in Database.Beam.Query.Combinators

type HaskellLiteralForQExpr (table (QGenExpr context be s)) = table Identity
type HaskellLiteralForQExpr (table (Nullable f)) 
Instance details

Defined in Database.Beam.Query.Combinators

type HaskellLiteralForQExpr (table (Nullable f)) = HaskellLiteralForQExpr_AddNullable (HaskellLiteralForQExpr (table f))
type HaskellLiteralForQExpr (QGenExpr context be s a) 
Instance details

Defined in Database.Beam.Query.Combinators

type HaskellLiteralForQExpr (QGenExpr context be s a) = a

class SqlValable a where #

Methods

val_ :: HaskellLiteralForQExpr a -> a #

Instances
(Beamable table, BeamSqlBackend be, FieldsFulfillConstraint (BeamSqlBackendCanSerialize be) table) => SqlValable (table (QGenExpr ctxt be s)) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

val_ :: HaskellLiteralForQExpr (table (QGenExpr ctxt be s)) -> table (QGenExpr ctxt be s) #

(Beamable table, BeamSqlBackend be, FieldsFulfillConstraintNullable (BeamSqlBackendCanSerialize be) table) => SqlValable (table (Nullable (QGenExpr ctxt be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

val_ :: HaskellLiteralForQExpr (table (Nullable (QGenExpr ctxt be s))) -> table (Nullable (QGenExpr ctxt be s)) #

(BeamSqlBackendCanSerialize be a, BeamSqlBackend be) => SqlValable (QGenExpr ctxt be s a) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

val_ :: HaskellLiteralForQExpr (QGenExpr ctxt be s a) -> QGenExpr ctxt be s a #

class SqlOrderable be a | a -> be #

Minimal complete definition

makeSQLOrdering

Instances
SqlOrderable be a => SqlOrderable be [a] 
Instance details

Defined in Database.Beam.Query.Combinators

(SqlOrderable be a, SqlOrderable be b) => SqlOrderable be (a, b) 
Instance details

Defined in Database.Beam.Query.Combinators

SqlOrderable be (QOrd be s a) 
Instance details

Defined in Database.Beam.Query.Combinators

(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c) => SqlOrderable be (a, b, c) 
Instance details

Defined in Database.Beam.Query.Combinators

(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c, SqlOrderable be d) => SqlOrderable be (a, b, c, d) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

makeSQLOrdering :: Proxy be -> (a, b, c, d) -> [WithExprContext (BeamSqlBackendOrderingSyntax be)]

(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c, SqlOrderable be d, SqlOrderable be e) => SqlOrderable be (a, b, c, d, e) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

makeSQLOrdering :: Proxy be -> (a, b, c, d, e) -> [WithExprContext (BeamSqlBackendOrderingSyntax be)]

(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c, SqlOrderable be d, SqlOrderable be e, SqlOrderable be f) => SqlOrderable be (a, b, c, d, e, f) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

makeSQLOrdering :: Proxy be -> (a, b, c, d, e, f) -> [WithExprContext (BeamSqlBackendOrderingSyntax be)]

(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c, SqlOrderable be d, SqlOrderable be e, SqlOrderable be f, SqlOrderable be g) => SqlOrderable be (a, b, c, d, e, f, g) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

makeSQLOrdering :: Proxy be -> (a, b, c, d, e, f, g) -> [WithExprContext (BeamSqlBackendOrderingSyntax be)]

(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c, SqlOrderable be d, SqlOrderable be e, SqlOrderable be f, SqlOrderable be g, SqlOrderable be h) => SqlOrderable be (a, b, c, d, e, f, g, h) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

makeSQLOrdering :: Proxy be -> (a, b, c, d, e, f, g, h) -> [WithExprContext (BeamSqlBackendOrderingSyntax be)]

class SqlJustable a b | b -> a where #

Type class for things that can be nullable. This includes 'QExpr (Maybe a)', 'tbl (Nullable QExpr)', and 'PrimaryKey tbl (Nullable QExpr)'

Methods

just_ :: a -> b #

Given something of type 'QExpr a', 'tbl QExpr', or 'PrimaryKey tbl QExpr', turn it into a 'QExpr (Maybe a)', 'tbl (Nullable QExpr)', or 'PrimaryKey t (Nullable QExpr)' respectively that contains the same values.

nothing_ :: b #

Return either a 'QExpr (Maybe x)' representing Nothing or a nullable Table or PrimaryKey filled with Nothing.

Instances
(Table t, BeamSqlBackend be) => SqlJustable (t (QExpr be s)) (t (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: t (QExpr be s) -> t (Nullable (QExpr be s)) #

nothing_ :: t (Nullable (QExpr be s)) #

Table t => SqlJustable (t Identity) (t (Nullable Identity)) 
Instance details

Defined in Database.Beam.Query.Combinators

(Table t, BeamSqlBackend be) => SqlJustable (PrimaryKey t (QExpr be s)) (PrimaryKey t (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: PrimaryKey t (QExpr be s) -> PrimaryKey t (Nullable (QExpr be s)) #

nothing_ :: PrimaryKey t (Nullable (QExpr be s)) #

Table t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity)) 
Instance details

Defined in Database.Beam.Query.Combinators

BeamSqlBackend be => SqlJustable (QExpr be s a) (QExpr be s (Maybe a)) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: QExpr be s a -> QExpr be s (Maybe a) #

nothing_ :: QExpr be s (Maybe a) #

data QIfCond context be s a #

data QIfElse context be s a #

class BeamSqlBackend be => SqlDeconstructMaybe be a nonNullA s | a s -> be, a -> nonNullA, a -> s, nonNullA -> s where #

Type class for anything which can be checked for null-ness. This includes 'QExpr (Maybe a)' as well as Tables or PrimaryKeys over 'Nullable QExpr'.

Methods

isJust_ :: a -> QGenExpr ctxt be s Bool #

Returns a QGenExpr that evaluates to true when the first argument is not null

isNothing_ :: a -> QGenExpr ctxt be s Bool #

Returns a QGenExpr that evaluates to true when the first argument is null

maybe_ :: QGenExpr ctxt be s y -> (nonNullA -> QGenExpr ctxt be s y) -> a -> QGenExpr ctxt be s y #

Given an object (third argument) which may or may not be null, return the default value if null (first argument), or transform the value that could be null to yield the result of the expression (second argument)

Instances
(BeamSqlBackend be, Beamable t) => SqlDeconstructMaybe be (t (Nullable (QGenExpr ctxt be s))) (t (QGenExpr ctxt be s)) s 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

isJust_ :: t (Nullable (QGenExpr ctxt be s)) -> QGenExpr ctxt0 be s Bool #

isNothing_ :: t (Nullable (QGenExpr ctxt be s)) -> QGenExpr ctxt0 be s Bool #

maybe_ :: QGenExpr ctxt0 be s y -> (t (QGenExpr ctxt be s) -> QGenExpr ctxt0 be s y) -> t (Nullable (QGenExpr ctxt be s)) -> QGenExpr ctxt0 be s y #

BeamSqlBackend be => SqlDeconstructMaybe be (QGenExpr ctxt be s (Maybe x)) (QGenExpr ctxt be s x) s 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

isJust_ :: QGenExpr ctxt be s (Maybe x) -> QGenExpr ctxt0 be s Bool #

isNothing_ :: QGenExpr ctxt be s (Maybe x) -> QGenExpr ctxt0 be s Bool #

maybe_ :: QGenExpr ctxt0 be s y -> (QGenExpr ctxt be s x -> QGenExpr ctxt0 be s y) -> QGenExpr ctxt be s (Maybe x) -> QGenExpr ctxt0 be s y #

reuse :: ReusableQ be db res -> Q be db s (WithRewrittenThread QAnyScope s res) #

data With be (db :: (Type -> Type) -> Type) a #

Instances
Monad (With be db) 
Instance details

Defined in Database.Beam.Query.CTE

Methods

(>>=) :: With be db a -> (a -> With be db b) -> With be db b #

(>>) :: With be db a -> With be db b -> With be db b #

return :: a -> With be db a #

fail :: String -> With be db a #

Functor (With be db) 
Instance details

Defined in Database.Beam.Query.CTE

Methods

fmap :: (a -> b) -> With be db a -> With be db b #

(<$) :: a -> With be db b -> With be db a #

IsSql99RecursiveCommonTableExpressionSelectSyntax (BeamSqlBackendSelectSyntax be) => MonadFix (With be db) 
Instance details

Defined in Database.Beam.Query.CTE

Methods

mfix :: (a -> With be db a) -> With be db a #

Applicative (With be db) 
Instance details

Defined in Database.Beam.Query.CTE

Methods

pure :: a -> With be db a #

(<*>) :: With be db (a -> b) -> With be db a -> With be db b #

liftA2 :: (a -> b -> c) -> With be db a -> With be db b -> With be db c #

(*>) :: With be db a -> With be db b -> With be db b #

(<*) :: With be db a -> With be db b -> With be db a #

data ReusableQ be (db :: (Type -> Type) -> Type) res #

agg_ :: QAgg be s a -> QAgg be s a #

Force a QGenExpr to be typed as an aggregate. Useful for defining custom aggregates for use in aggregate_.

valueExpr_ :: QExpr be s a -> QExpr be s a #

Force a QGenExpr to be typed as a value expression (a QGenExpr). Useful for getting around type-inference errors with supplying the entire type.

class (Monoid (CustomSqlSyntax syntax), Semigroup (CustomSqlSyntax syntax), IsString (CustomSqlSyntax syntax)) => IsCustomSqlSyntax syntax where #

A type-class for expression syntaxes that can embed custom expressions.

Associated Types

data CustomSqlSyntax syntax :: Type #

Methods

customExprSyntax :: CustomSqlSyntax syntax -> syntax #

Given an arbitrary string-like expression, produce a syntax that represents the ByteString as a SQL expression.

renderSyntax :: syntax -> CustomSqlSyntax syntax #

Given an arbitrary syntax, produce a string-like value that corresponds to how that syntax would look when rendered in the backend.

class IsCustomExprFn fn res | res -> fn where #

Methods

customExpr_ :: fn -> res #

Instances
BeamSqlBackendHasCustomSyntax be => IsCustomExprFn (CustomSqlSnippet be) (QGenExpr ctxt be s res) 
Instance details

Defined in Database.Beam.Query.CustomSQL

Methods

customExpr_ :: CustomSqlSnippet be -> QGenExpr ctxt be s res #

(IsCustomExprFn a res, BeamSqlBackendHasCustomSyntax be) => IsCustomExprFn (CustomSqlSnippet be -> a) (QGenExpr ctxt be s r -> res) 
Instance details

Defined in Database.Beam.Query.CustomSQL

Methods

customExpr_ :: (CustomSqlSnippet be -> a) -> QGenExpr ctxt be s r -> res #

maybeType :: DataType be a -> DataType be (Maybe a) #

Haskell requires DataTypes to match exactly. Use this function to convert a DataType that expects a concrete value to one expecting a Maybe

array :: (Typeable a, BeamSql99DataTypeBackend be) => DataType be a -> Int -> DataType be (Vector a) #

SQL99 array data types

binaryLargeObject :: BeamSql99DataTypeBackend be => DataType be Text #

SQL99 BLOB data type

boolean :: BeamSql99DataTypeBackend be => DataType be Bool #

SQL99 BOOLEAN data type

time :: BeamSqlBackend be => Maybe Word -> DataType be TimeOfDay #

SQL92 TIME data type

timestamp :: BeamSqlBackend be => DataType be LocalTime #

SQL92 TIMESTAMP WITHOUT TIME ZONE data type

timestamptz :: BeamSqlBackend be => DataType be LocalTime #

SQL92 TIMESTAMP WITH TIME ZONE data type

numeric :: BeamSqlBackend be => Maybe (Word, Maybe Word) -> DataType be Scientific #

SQL92 NUMERIC data type

double :: BeamSqlBackend be => DataType be Double #

SQL92 DOUBLE data type

nationalChar :: BeamSqlBackend be => Maybe Word -> DataType be Text #

SQL92 NATIONAL CHARACTER data type

nationalVarchar :: BeamSqlBackend be => Maybe Word -> DataType be Text #

SQL92 NATIONAL CHARACTER VARYING data type

varchar :: BeamSqlBackend be => Maybe Word -> DataType be Text #

SQL92 VARCHAR data type

char :: BeamSqlBackend be => Maybe Word -> DataType be Text #

SQL92 CHAR data type

date :: BeamSqlBackend be => DataType be Day #

SQL92 DATE data type

varbinary :: (BeamSqlBackend be, BeamSqlT021Backend be) => Maybe Word -> DataType be Integer #

SQL2003 Optional VARBINARY data type

binary :: (BeamSqlBackend be, BeamSqlT021Backend be) => Maybe Word -> DataType be Integer #

SQL2003 Optional BINARY data type

bigint :: (BeamSqlBackend be, BeamSqlT071Backend be, Integral a) => DataType be a #

SQL2008 Optional BIGINT data type

smallint :: (BeamSqlBackend be, Integral a) => DataType be a #

SQL92 SMALLINT data type

int :: (BeamSqlBackend be, Integral a) => DataType be a #

SQL92 INTEGER data type

cast_ :: BeamSqlBackend be => QGenExpr ctxt be s a -> DataType be b -> QGenExpr ctxt be s b #

Cast a value to a specific data type, specified using DataType.

Note: this may fail at run-time if the cast is invalid for a particular value

newtype DataType be a #

A data type in a given IsSql92DataTypeSyntax which describes a SQL type mapping to the Haskell type a

Instances
Eq (BeamSqlBackendCastTargetSyntax be) => Eq (DataType be a) 
Instance details

Defined in Database.Beam.Query.DataTypes

Methods

(==) :: DataType be a -> DataType be a -> Bool #

(/=) :: DataType be a -> DataType be a -> Bool #

Sql92DisplaySyntax (BeamSqlBackendCastTargetSyntax be) => Show (DataType be a) 
Instance details

Defined in Database.Beam.Query.DataTypes

Methods

showsPrec :: Int -> DataType be a -> ShowS #

show :: DataType be a -> String #

showList :: [DataType be a] -> ShowS #

seconds_ :: (BeamSqlBackend be, HasSqlTime tgt) => ExtractField be tgt Double #

Extracts the hours, minutes, or seconds from any timestamp or time field

minutes_ :: (BeamSqlBackend be, HasSqlTime tgt) => ExtractField be tgt Double #

Extracts the hours, minutes, or seconds from any timestamp or time field

hour_ :: (BeamSqlBackend be, HasSqlTime tgt) => ExtractField be tgt Double #

Extracts the hours, minutes, or seconds from any timestamp or time field

extract_ :: BeamSqlBackend be => ExtractField be tgt a -> QGenExpr ctxt be s tgt -> QGenExpr cxt be s a #

Extracts the given field from the target expression

newtype ExtractField be tgt a #

A field that can be extracted from SQL expressions of type tgt that results in a type a, in backend be.

class HasSqlTime tgt #

Type-class for types that contain a time component

Instances
HasSqlTime UTCTime 
Instance details

Defined in Database.Beam.Query.Extract

HasSqlTime LocalTime 
Instance details

Defined in Database.Beam.Query.Extract

HasSqlTime TimeOfDay 
Instance details

Defined in Database.Beam.Query.Extract

class HasSqlDate tgt #

Type-class for types that contain a date component

Instances
HasSqlDate UTCTime 
Instance details

Defined in Database.Beam.Query.Extract

HasSqlDate LocalTime 
Instance details

Defined in Database.Beam.Query.Extract

HasSqlDate Day 
Instance details

Defined in Database.Beam.Query.Extract

in_ :: BeamSqlBackend be => QGenExpr context be s a -> [QGenExpr context be s a] -> QGenExpr context be s Bool infix 4 #

SQL IN predicate

between_ :: BeamSqlBackend be => QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool infix 4 #

SQL BETWEEN clause

anyIn_ :: BeamSqlBackend be => [QExpr be s a] -> QQuantified be s a #

A QQuantified representing a SQL ANY(..) for use with a quantified comparison operator

Accepts an explicit list of typed expressions. Use anyOf_ for a subquery

anyOf_ :: (BeamSqlBackend be, HasQBuilder be) => Q be db (QNested s) (QExpr be (QNested s) a) -> QQuantified be s a #

A QQuantified representing a SQL ANY(..) for use with a quantified comparison operator

Accepts a subquery. Use anyIn_ for an explicit list

allIn_ :: BeamSqlBackend be => [QExpr be s a] -> QQuantified be s a #

A QQuantified representing a SQL ALL(..) for use with a quantified comparison operator

Accepts an explicit list of typed expressions. Use allOf_ for a subquery

allOf_ :: (BeamSqlBackend be, HasQBuilder be) => Q be db (QNested s) (QExpr be (QNested s) a) -> QQuantified be s a #

A QQuantified representing a SQL ALL(..) for use with a quantified comparison operator

Accepts a subquery. Use allIn_ for an explicit list

fromPossiblyNullBool_ :: QGenExpr context be s (Maybe Bool) -> QGenExpr context be s SqlBool #

Convert a possibly NULL Bool to a SqlBool.

possiblyNullBool_ :: QGenExpr context be s SqlBool -> QGenExpr context be s (Maybe Bool) #

Retrieve a SqlBool value as a potentially NULL Bool. This is useful if you want to get the value of a SQL boolean expression directly, without having to specify what to do on UNKNOWN. Note that both NULL and UNKNOWN will be returned as Nothing.

unknownAs_ :: BeamSqlBackend be => Bool -> QGenExpr context be s SqlBool -> QGenExpr context be s Bool #

Return the first argument if the expression has the unknown SQL value See sqlBool_ for the inverse

isNotUnknown_ :: BeamSqlBackend be => QGenExpr context be s SqlBool -> QGenExpr context be s Bool #

SQL IS NOT UNKNOWN operator

isUnknown_ :: BeamSqlBackend be => QGenExpr context be s SqlBool -> QGenExpr context be s Bool #

SQL IS UNKNOWN operator

isNotFalse_ :: BeamSqlBackend be => QGenExpr context be s SqlBool -> QGenExpr context be s Bool #

SQL IS NOT FALSE operator

isFalse_ :: BeamSqlBackend be => QGenExpr context be s SqlBool -> QGenExpr context be s Bool #

SQL IS FALSE operator

isNotTrue_ :: BeamSqlBackend be => QGenExpr context be s SqlBool -> QGenExpr context be s Bool #

SQL IS NOT TRUE operator

isTrue_ :: BeamSqlBackend be => QGenExpr context be s SqlBool -> QGenExpr context be s Bool #

SQL IS TRUE operator

sqlBool_ :: QGenExpr context syntax s Bool -> QGenExpr context syntax s SqlBool #

Convert a known not null bool to a SqlBool. See unknownAs_ for the inverse

data QQuantified be s r #

A data structure representing the set to quantify a comparison operator over.

Instances
(BeamSqlBackend be, HasSqlQuantifiedEqualityCheck be a) => SqlEqQuantified (QGenExpr context be s) (QQuantified be s a) (QGenExpr context be s a)

Two arbitrary expressions can be quantifiably compared for equality.

Instance details

Defined in Database.Beam.Query.Ord

Methods

(==*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s SqlBool #

(/=*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s SqlBool #

BeamSqlBackend be => SqlOrdQuantified (QGenExpr context be s) (QQuantified be s a) (QGenExpr context be s a) 
Instance details

Defined in Database.Beam.Query.Ord

Methods

(<*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

(>*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

(<=*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

(>=*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

class SqlEq (expr :: Type -> Type) a | a -> expr where #

Class for expression types or expression containers for which there is a notion of equality.

Instances are provided to check the equality of expressions of the same type as well as entire Beamable types parameterized over QGenExpr

Methods

(==.) :: a -> a -> expr Bool infix 4 #

Given two expressions, returns whether they are equal, using Haskell semantics (NULLs handled properly)

(/=.) :: a -> a -> expr Bool infix 4 #

Given two expressions, returns whether they are not equal, using Haskell semantics (NULLs handled properly)

(==?.) :: a -> a -> expr SqlBool #

Given two expressions, returns the SQL tri-state boolean when compared for equality

(/=?.) :: a -> a -> expr SqlBool #

Given two expressions, returns the SQL tri-state boolean when compared for inequality

Instances
(BeamSqlBackend be, Beamable tbl, FieldsFulfillConstraint (HasSqlEqualityCheck be) tbl) => SqlEq (QGenExpr context be s) (tbl (QGenExpr context be s))

Compare two arbitrary Beamable types containing QGenExprs for equality.

Instance details

Defined in Database.Beam.Query.Ord

Methods

(==.) :: tbl (QGenExpr context be s) -> tbl (QGenExpr context be s) -> QGenExpr context be s Bool #

(/=.) :: tbl (QGenExpr context be s) -> tbl (QGenExpr context be s) -> QGenExpr context be s Bool #

(==?.) :: tbl (QGenExpr context be s) -> tbl (QGenExpr context be s) -> QGenExpr context be s SqlBool #

(/=?.) :: tbl (QGenExpr context be s) -> tbl (QGenExpr context be s) -> QGenExpr context be s SqlBool #

(BeamSqlBackend be, Beamable tbl, FieldsFulfillConstraintNullable (HasSqlEqualityCheck be) tbl) => SqlEq (QGenExpr context be s) (tbl (Nullable (QGenExpr context be s))) 
Instance details

Defined in Database.Beam.Query.Ord

Methods

(==.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s Bool #

(/=.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s Bool #

(==?.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s SqlBool #

(/=?.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s SqlBool #

(BeamSqlBackend be, HasSqlEqualityCheck be a) => SqlEq (QGenExpr context be s) (QGenExpr context be s a)

Compare two arbitrary expressions (of the same type) for equality

Instance details

Defined in Database.Beam.Query.Ord

Methods

(==.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

(/=.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

(==?.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s SqlBool #

(/=?.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s SqlBool #

class SqlEq expr a => SqlEqQuantified (expr :: Type -> Type) quantified a | a -> expr quantified where #

Class for expression types for which there is a notion of quantified equality.

Methods

(==*.) :: a -> quantified -> expr SqlBool infix 4 #

Quantified equality and inequality using SQL semantics (tri-state boolean)

(/=*.) :: a -> quantified -> expr SqlBool infix 4 #

Quantified equality and inequality using SQL semantics (tri-state boolean)

Instances
(BeamSqlBackend be, HasSqlQuantifiedEqualityCheck be a) => SqlEqQuantified (QGenExpr context be s) (QQuantified be s a) (QGenExpr context be s a)

Two arbitrary expressions can be quantifiably compared for equality.

Instance details

Defined in Database.Beam.Query.Ord

Methods

(==*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s SqlBool #

(/=*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s SqlBool #

class BeamSqlBackend be => HasSqlEqualityCheck be a where #

Class for Haskell types that can be compared for equality in the given backend

Minimal complete definition

Nothing

Instances
HasSqlEqualityCheck Postgres Bool 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Double 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Float 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Int 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Int8 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Int16 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Int32 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Int64 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Integer 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Word 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Word8 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Word16 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Word32 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Word64 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Text 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres ByteString 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres ByteString 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Scientific 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres UTCTime 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Value 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Text 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres TsVector 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlEqualityCheck Postgres TsVectorConfig 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlEqualityCheck Postgres TsQuery 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlEqualityCheck Postgres PgMoney 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlEqualityCheck Postgres Oid 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres HStoreList 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres HStoreMap 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres LocalTimestamp 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres UTCTimestamp 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres ZonedTimestamp 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Date 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres ZonedTime 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres LocalTime 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres TimeOfDay 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres NominalDiffTime 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres Day 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres UUID 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck be a => HasSqlEqualityCheck be (SqlSerial a) 
Instance details

Defined in Database.Beam.Query.Ord

(HasSqlEqualityCheck be a, CanCheckMaybeEquality a) => HasSqlEqualityCheck be (Maybe a) 
Instance details

Defined in Database.Beam.Query.Ord

HasSqlEqualityCheck Postgres [Char] 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres (PgJSON a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlEqualityCheck Postgres (PgJSONB a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlEqualityCheck Postgres (CI Text) 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres (CI Text) 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres (Vector a) 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlEqualityCheck Postgres (PgRange n a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlEqualityCheck Postgres a => HasSqlEqualityCheck Postgres (Tagged t a) 
Instance details

Defined in Database.Beam.Postgres.Types

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Word8 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Word64 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Word32 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Word16 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Word 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) UTCTime 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) TimeOfDay 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Text 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) LocalTime 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Integer 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Int8 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Int64 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Int32 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Int16 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Int 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Float 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Double 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Day 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Bool 
Instance details

Defined in Database.Beam.Query.Ord

(BeamSqlBackend (MockSqlBackend cmd), HasSqlEqualityCheck (MockSqlBackend cmd) a) => HasSqlEqualityCheck (MockSqlBackend cmd) (Tagged t a) 
Instance details

Defined in Database.Beam.Query.Ord

class HasSqlEqualityCheck be a => HasSqlQuantifiedEqualityCheck be a where #

Class for Haskell types that can be compared for quantified equality in the given backend

Minimal complete definition

Nothing

Instances
HasSqlQuantifiedEqualityCheck Postgres Bool 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Double 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Float 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Int 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Int8 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Int16 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Int32 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Int64 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Integer 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Word 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Word8 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Word16 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Word32 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Word64 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Text 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres ByteString 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres ByteString 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Scientific 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres UTCTime 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Value 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Text 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres TsVector 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlQuantifiedEqualityCheck Postgres TsVectorConfig 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlQuantifiedEqualityCheck Postgres TsQuery 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlQuantifiedEqualityCheck Postgres PgMoney 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlQuantifiedEqualityCheck Postgres Oid 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres HStoreList 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres HStoreMap 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres LocalTimestamp 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres UTCTimestamp 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres ZonedTimestamp 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Date 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres ZonedTime 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres LocalTime 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres TimeOfDay 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres NominalDiffTime 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres Day 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres UUID 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck syntax a => HasSqlQuantifiedEqualityCheck syntax (SqlSerial a) 
Instance details

Defined in Database.Beam.Query.Ord

(HasSqlQuantifiedEqualityCheck syntax a, CanCheckMaybeEquality a) => HasSqlQuantifiedEqualityCheck syntax (Maybe a) 
Instance details

Defined in Database.Beam.Query.Ord

HasSqlQuantifiedEqualityCheck Postgres [Char] 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres (PgJSON a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlQuantifiedEqualityCheck Postgres (PgJSONB a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlQuantifiedEqualityCheck Postgres (CI Text) 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres (CI Text) 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres (Vector a) 
Instance details

Defined in Database.Beam.Postgres.Types

HasSqlQuantifiedEqualityCheck Postgres (PgRange n a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

HasSqlQuantifiedEqualityCheck Postgres a => HasSqlQuantifiedEqualityCheck Postgres (Tagged t a) 
Instance details

Defined in Database.Beam.Postgres.Types

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Word8 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Word64 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Word32 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Word16 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Word 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) UTCTime 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) TimeOfDay 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Text 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) LocalTime 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Integer 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Int8 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Int64 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Int32 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Int16 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Int 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Float 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Double 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Day 
Instance details

Defined in Database.Beam.Query.Ord

BeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Bool 
Instance details

Defined in Database.Beam.Query.Ord

(BeamSqlBackend (MockSqlBackend cmd), HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) a) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) (Tagged t a) 
Instance details

Defined in Database.Beam.Query.Ord

class SqlOrd (expr :: Type -> Type) e | e -> expr where #

Class for expression types or expression containers for which there is a notion of ordering.

Instances are provided to check the ordering of expressions of the same type. Since there is no universal notion of ordering for an arbitrary number of expressions, no instance is provided for Beamable types.

Methods

(<.) :: e -> e -> expr Bool infix 4 #

(>.) :: e -> e -> expr Bool infix 4 #

(<=.) :: e -> e -> expr Bool infix 4 #

(>=.) :: e -> e -> expr Bool infix 4 #

Instances
BeamSqlBackend be => SqlOrd (QGenExpr context be s) (QGenExpr context be s a) 
Instance details

Defined in Database.Beam.Query.Ord

Methods

(<.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

(>.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

(<=.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

(>=.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

class SqlOrd expr e => SqlOrdQuantified (expr :: Type -> Type) quantified e | e -> expr quantified where #

Class for things which can be quantifiably compared.

Methods

(<*.) :: e -> quantified -> expr Bool infix 4 #

(>*.) :: e -> quantified -> expr Bool infix 4 #

(<=*.) :: e -> quantified -> expr Bool infix 4 #

(>=*.) :: e -> quantified -> expr Bool infix 4 #

Instances
BeamSqlBackend be => SqlOrdQuantified (QGenExpr context be s) (QQuantified be s a) (QGenExpr context be s a) 
Instance details

Defined in Database.Beam.Query.Ord

Methods

(<*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

(>*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

(<=*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

(>=*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

concat_ :: BeamSql99ConcatExpressionBackend be => [QGenExpr context be s Text] -> QGenExpr context be s Text #

SQL CONCAT function

mod_ :: (Integral a, BeamSqlBackend be) => QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s a infixl 7 #

SQL % operator

div_ :: (Integral a, BeamSqlBackend be) => QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s a infixl 7 #

SQL / operator

sqlNot_ :: BeamSqlBackend be => QGenExpr context be s SqlBool -> QGenExpr context be s SqlBool #

SQL NOT operator, but operating on SqlBool instead

not_ :: BeamSqlBackend be => QGenExpr context be s Bool -> QGenExpr context be s Bool #

SQL NOT operator

similarTo_ :: (BeamSqlBackendIsString be text, BeamSql99ExpressionBackend be) => QGenExpr ctxt be s text -> QGenExpr ctxt be s text -> QGenExpr ctxt be s text infix 4 #

SQL99 SIMILAR TO operator

like_ :: (BeamSqlBackendIsString be text, BeamSqlBackend be) => QGenExpr ctxt be s text -> QGenExpr ctxt be s text -> QGenExpr ctxt be s Bool infix 4 #

SQL LIKE operator

(||?.) :: BeamSqlBackend be => QGenExpr context be s SqlBool -> QGenExpr context be s SqlBool -> QGenExpr context be s SqlBool infixr 2 #

SQL OR operator

(&&?.) :: BeamSqlBackend be => QGenExpr context be s SqlBool -> QGenExpr context be s SqlBool -> QGenExpr context be s SqlBool infixr 3 #

SQL AND operator for SqlBool

(||.) :: BeamSqlBackend be => QGenExpr context be s Bool -> QGenExpr context be s Bool -> QGenExpr context be s Bool infixr 2 #

SQL OR operator

(&&.) :: BeamSqlBackend be => QGenExpr context be s Bool -> QGenExpr context be s Bool -> QGenExpr context be s Bool infixr 3 #

SQL AND operator

data SqlBool #

Phantom type representing a SQL Tri-state boolean -- true, false, and unknown

This type has no values because it cannot be sent to or retrieved from the database directly. Use isTrue_, isFalse_, isNotTrue_, isNotFalse_, isUnknown_, isNotUnknown_, and unknownAs_ to retrieve the corresponding Bool value.

type family QExprToIdentity x :: Type #

Instances
type QExprToIdentity () 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity () = ()
type QExprToIdentity (table (Nullable c)) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (table (Nullable c)) = Maybe (QExprToIdentity (table c))
type QExprToIdentity (table (QGenExpr context syntax s)) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (table (QGenExpr context syntax s)) = table Identity
type QExprToIdentity (a, b) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (Vector n a) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (a, b, c) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (a, b, c, d) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (QGenExpr context syntax s a) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (QGenExpr context syntax s a) = a
type QExprToIdentity (a, b, c, d, e) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (a, b, c, d, e, f) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (a, b, c, d, e, f, g) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (a, b, c, d, e, f, g, h) 
Instance details

Defined in Database.Beam.Query.Types

type family QExprToField x :: Type #

Instances
type QExprToField () 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField () = ()
type QExprToField (table (Nullable (QGenExpr context syntax s))) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (table (Nullable (QGenExpr context syntax s))) = table (Nullable (QField s))
type QExprToField (table (QGenExpr context syntax s)) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (table (QGenExpr context syntax s)) = table (QField s)
type QExprToField (a, b) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (Vector n a) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (a, b, c) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (a, b, c, d) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (QGenExpr ctxt syntax s a) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (QGenExpr ctxt syntax s a) = QField s a
type QExprToField (a, b, c, d, e) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (a, b, c, d, e, f) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (a, b, c, d, e, f, g) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (a, b, c, d, e, f, g, h) 
Instance details

Defined in Database.Beam.Query.Types

data Q be (db :: (Type -> Type) -> Type) s a #

The type of queries over the database db returning results of type a. The s argument is a threading argument meant to restrict cross-usage of QGenExprs. syntax represents the SQL syntax that this query is building.

Instances
Monad (Q be db s) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

(>>=) :: Q be db s a -> (a -> Q be db s b) -> Q be db s b #

(>>) :: Q be db s a -> Q be db s b -> Q be db s b #

return :: a -> Q be db s a #

fail :: String -> Q be db s a #

Functor (Q be db s) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

fmap :: (a -> b) -> Q be db s a -> Q be db s b #

(<$) :: a -> Q be db s b -> Q be db s a #

Applicative (Q be db s) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

pure :: a -> Q be db s a #

(<*>) :: Q be db s (a -> b) -> Q be db s a -> Q be db s b #

liftA2 :: (a -> b -> c) -> Q be db s a -> Q be db s b -> Q be db s c #

(*>) :: Q be db s a -> Q be db s b -> Q be db s b #

(<*) :: Q be db s a -> Q be db s b -> Q be db s a #

data QField s ty #

Instances
Beamable t => ProjectibleWithPredicate AnyType () Text (t (QField s)) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy AnyType -> Proxy ((), Text) -> (forall context. AnyType context => Proxy context -> Proxy () -> Text -> m Text) -> t (QField s) -> m (t (QField s)) #

projectSkeleton' :: Monad m => Proxy AnyType -> Proxy ((), Text) -> (forall context. AnyType context => Proxy context -> Proxy () -> m Text) -> m (t (QField s)) #

Beamable t => ProjectibleWithPredicate AnyType () Text (t (Nullable (QField s))) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy AnyType -> Proxy ((), Text) -> (forall context. AnyType context => Proxy context -> Proxy () -> Text -> m Text) -> t (Nullable (QField s)) -> m (t (Nullable (QField s))) #

projectSkeleton' :: Monad m => Proxy AnyType -> Proxy ((), Text) -> (forall context. AnyType context => Proxy context -> Proxy () -> m Text) -> m (t (Nullable (QField s))) #

ProjectibleWithPredicate AnyType () Text (QField s a) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy AnyType -> Proxy ((), Text) -> (forall context. AnyType context => Proxy context -> Proxy () -> Text -> m Text) -> QField s a -> m (QField s a) #

projectSkeleton' :: Monad m => Proxy AnyType -> Proxy ((), Text) -> (forall context. AnyType context => Proxy context -> Proxy () -> m Text) -> m (QField s a) #

(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (QField s)) (tbl (QExpr be s)) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

(<-.) :: tbl (QField s) -> tbl (QExpr be s) -> QAssignment be s #

(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (Nullable (QField s))) (tbl (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

(<-.) :: tbl (Nullable (QField s)) -> tbl (Nullable (QExpr be s)) -> QAssignment be s #

BeamSqlBackend be => SqlUpdatable be s (QField s a) (QExpr be s a) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

(<-.) :: QField s a -> QExpr be s a -> QAssignment be s #

Eq (QField s ty) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

(==) :: QField s ty -> QField s ty -> Bool #

(/=) :: QField s ty -> QField s ty -> Bool #

Ord (QField s ty) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

compare :: QField s ty -> QField s ty -> Ordering #

(<) :: QField s ty -> QField s ty -> Bool #

(<=) :: QField s ty -> QField s ty -> Bool #

(>) :: QField s ty -> QField s ty -> Bool #

(>=) :: QField s ty -> QField s ty -> Bool #

max :: QField s ty -> QField s ty -> QField s ty #

min :: QField s ty -> QField s ty -> QField s ty #

Show (QField s ty) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

showsPrec :: Int -> QField s ty -> ShowS #

show :: QField s ty -> String #

showList :: [QField s ty] -> ShowS #

data QAssignment be s #

Instances
Semigroup (QAssignment be s) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

(<>) :: QAssignment be s -> QAssignment be s -> QAssignment be s #

sconcat :: NonEmpty (QAssignment be s) -> QAssignment be s #

stimes :: Integral b => b -> QAssignment be s -> QAssignment be s #

Monoid (QAssignment be s) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

mempty :: QAssignment be s #

mappend :: QAssignment be s -> QAssignment be s -> QAssignment be s #

mconcat :: [QAssignment be s] -> QAssignment be s #

data QFieldAssignment be (tbl :: (Type -> Type) -> Type) a #

data QGroupingContext #

Instances
Beamable tbl => QGroupable (tbl (QExpr be s)) (tbl (QGroupExpr be s))

group_ for any Beamable type. Adds every field in the type to the grouping key. This is the equivalent of including the grouping expression of each field in the type as part of the aggregate projection

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: tbl (QExpr be s) -> tbl (QGroupExpr be s) #

Beamable tbl => QGroupable (tbl (Nullable (QExpr be s))) (tbl (Nullable (QGroupExpr be s)))

group_ for any Beamable type. Adds every field in the type to the grouping key. This is the equivalent of including the grouping expression of each field in the type as part of the aggregate projection

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: tbl (Nullable (QExpr be s)) -> tbl (Nullable (QGroupExpr be s)) #

QGroupable (QExpr be s a) (QGroupExpr be s a)

group_ for simple value expressions.

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: QExpr be s a -> QGroupExpr be s a #

type ContextName QGroupingContext 
Instance details

Defined in Database.Beam.Query.Internal

type ContextName QGroupingContext = "an aggregate grouping"

data QValueContext #

Instances
(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (QField s)) (tbl (QExpr be s)) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

(<-.) :: tbl (QField s) -> tbl (QExpr be s) -> QAssignment be s #

(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (Nullable (QField s))) (tbl (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

(<-.) :: tbl (Nullable (QField s)) -> tbl (Nullable (QExpr be s)) -> QAssignment be s #

BeamSqlBackend be => SqlUpdatable be s (QField s a) (QExpr be s a) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

(<-.) :: QField s a -> QExpr be s a -> QAssignment be s #

PgIsArrayContext QValueContext 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Beamable tbl => QGroupable (tbl (QExpr be s)) (tbl (QGroupExpr be s))

group_ for any Beamable type. Adds every field in the type to the grouping key. This is the equivalent of including the grouping expression of each field in the type as part of the aggregate projection

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: tbl (QExpr be s) -> tbl (QGroupExpr be s) #

Beamable tbl => QGroupable (tbl (Nullable (QExpr be s))) (tbl (Nullable (QGroupExpr be s)))

group_ for any Beamable type. Adds every field in the type to the grouping key. This is the equivalent of including the grouping expression of each field in the type as part of the aggregate projection

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: tbl (Nullable (QExpr be s)) -> tbl (Nullable (QGroupExpr be s)) #

(Table t, BeamSqlBackend be) => SqlJustable (t (QExpr be s)) (t (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: t (QExpr be s) -> t (Nullable (QExpr be s)) #

nothing_ :: t (Nullable (QExpr be s)) #

(Table t, BeamSqlBackend be) => SqlJustable (PrimaryKey t (QExpr be s)) (PrimaryKey t (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: PrimaryKey t (QExpr be s) -> PrimaryKey t (Nullable (QExpr be s)) #

nothing_ :: PrimaryKey t (Nullable (QExpr be s)) #

QGroupable (QExpr be s a) (QGroupExpr be s a)

group_ for simple value expressions.

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: QExpr be s a -> QGroupExpr be s a #

BeamSqlBackend be => SqlJustable (QExpr be s a) (QExpr be s (Maybe a)) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: QExpr be s a -> QExpr be s (Maybe a) #

nothing_ :: QExpr be s (Maybe a) #

type ContextName QValueContext 
Instance details

Defined in Database.Beam.Query.Internal

type ContextName QValueContext = "a value"

data QWindowFrameContext #

Instances
type ContextName QWindowFrameContext 
Instance details

Defined in Database.Beam.Query.Internal

type ContextName QWindowFrameContext = "a window frame"

newtype QGenExpr context be s t #

The type of lifted beam expressions that will yield the haskell type t.

context is a type-level representation of the types of expressions this can contain. For example, QAggregateContext represents expressions that may contain aggregates, and QWindowingContext represents expressions that may contain OVER.

syntax is the expression syntax being built (usually a type that implements IsSql92ExpressionSyntax at least, but not always).

s is a state threading parameter that prevents QGenExprs from incompatible sources to be combined. For example, this is used to prevent monadic joins from depending on the result of previous joins (so-called LATERAL joins).

Instances
(Beamable t, contextPredicate context) => ProjectibleWithPredicate contextPredicate be (WithExprContext (BeamSqlBackendExpressionSyntax' be)) (t (QGenExpr context be s)) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy contextPredicate -> Proxy (be, WithExprContext (BeamSqlBackendExpressionSyntax' be)) -> (forall context0. contextPredicate context0 => Proxy context0 -> Proxy be -> WithExprContext (BeamSqlBackendExpressionSyntax' be) -> m (WithExprContext (BeamSqlBackendExpressionSyntax' be))) -> t (QGenExpr context be s) -> m (t (QGenExpr context be s)) #

projectSkeleton' :: Monad m => Proxy contextPredicate -> Proxy (be, WithExprContext (BeamSqlBackendExpressionSyntax' be)) -> (forall context0. contextPredicate context0 => Proxy context0 -> Proxy be -> m (WithExprContext (BeamSqlBackendExpressionSyntax' be))) -> m (t (QGenExpr context be s)) #

(Beamable t, contextPredicate context) => ProjectibleWithPredicate contextPredicate be (WithExprContext (BeamSqlBackendExpressionSyntax' be)) (t (Nullable (QGenExpr context be s))) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy contextPredicate -> Proxy (be, WithExprContext (BeamSqlBackendExpressionSyntax' be)) -> (forall context0. contextPredicate context0 => Proxy context0 -> Proxy be -> WithExprContext (BeamSqlBackendExpressionSyntax' be) -> m (WithExprContext (BeamSqlBackendExpressionSyntax' be))) -> t (Nullable (QGenExpr context be s)) -> m (t (Nullable (QGenExpr context be s))) #

projectSkeleton' :: Monad m => Proxy contextPredicate -> Proxy (be, WithExprContext (BeamSqlBackendExpressionSyntax' be)) -> (forall context0. contextPredicate context0 => Proxy context0 -> Proxy be -> m (WithExprContext (BeamSqlBackendExpressionSyntax' be))) -> m (t (Nullable (QGenExpr context be s))) #

(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (QField s)) (tbl (QExpr be s)) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

(<-.) :: tbl (QField s) -> tbl (QExpr be s) -> QAssignment be s #

(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (Nullable (QField s))) (tbl (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

(<-.) :: tbl (Nullable (QField s)) -> tbl (Nullable (QExpr be s)) -> QAssignment be s #

contextPredicate context => ProjectibleWithPredicate contextPredicate be (WithExprContext (BeamSqlBackendExpressionSyntax' be)) (QGenExpr context be s a) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy contextPredicate -> Proxy (be, WithExprContext (BeamSqlBackendExpressionSyntax' be)) -> (forall context0. contextPredicate context0 => Proxy context0 -> Proxy be -> WithExprContext (BeamSqlBackendExpressionSyntax' be) -> m (WithExprContext (BeamSqlBackendExpressionSyntax' be))) -> QGenExpr context be s a -> m (QGenExpr context be s a) #

projectSkeleton' :: Monad m => Proxy contextPredicate -> Proxy (be, WithExprContext (BeamSqlBackendExpressionSyntax' be)) -> (forall context0. contextPredicate context0 => Proxy context0 -> Proxy be -> m (WithExprContext (BeamSqlBackendExpressionSyntax' be))) -> m (QGenExpr context be s a) #

BeamSqlBackend be => SqlUpdatable be s (QField s a) (QExpr be s a) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

(<-.) :: QField s a -> QExpr be s a -> QAssignment be s #

Beamable tbl => ThreadRewritable s (tbl (QGenExpr ctxt syntax s)) 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type WithRewrittenThread s s' (tbl (QGenExpr ctxt syntax s)) :: Type #

Methods

rewriteThread :: Proxy s' -> tbl (QGenExpr ctxt syntax s) -> WithRewrittenThread s s' (tbl (QGenExpr ctxt syntax s)) #

Beamable tbl => ThreadRewritable s (tbl (Nullable (QGenExpr ctxt syntax s))) 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) :: Type #

Methods

rewriteThread :: Proxy s' -> tbl (Nullable (QGenExpr ctxt syntax s)) -> WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) #

(BeamSqlBackend be, Beamable t) => SqlDeconstructMaybe be (t (Nullable (QGenExpr ctxt be s))) (t (QGenExpr ctxt be s)) s 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

isJust_ :: t (Nullable (QGenExpr ctxt be s)) -> QGenExpr ctxt0 be s Bool #

isNothing_ :: t (Nullable (QGenExpr ctxt be s)) -> QGenExpr ctxt0 be s Bool #

maybe_ :: QGenExpr ctxt0 be s y -> (t (QGenExpr ctxt be s) -> QGenExpr ctxt0 be s y) -> t (Nullable (QGenExpr ctxt be s)) -> QGenExpr ctxt0 be s y #

ThreadRewritable s (QGenExpr ctxt syntax s a) 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type WithRewrittenThread s s' (QGenExpr ctxt syntax s a) :: Type #

Methods

rewriteThread :: Proxy s' -> QGenExpr ctxt syntax s a -> WithRewrittenThread s s' (QGenExpr ctxt syntax s a) #

BeamSqlBackend be => SqlDeconstructMaybe be (QGenExpr ctxt be s (Maybe x)) (QGenExpr ctxt be s x) s 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

isJust_ :: QGenExpr ctxt be s (Maybe x) -> QGenExpr ctxt0 be s Bool #

isNothing_ :: QGenExpr ctxt be s (Maybe x) -> QGenExpr ctxt0 be s Bool #

maybe_ :: QGenExpr ctxt0 be s y -> (QGenExpr ctxt be s x -> QGenExpr ctxt0 be s y) -> QGenExpr ctxt be s (Maybe x) -> QGenExpr ctxt0 be s y #

(Beamable table, BeamSqlBackend be, FieldsFulfillConstraint (BeamSqlBackendCanSerialize be) table) => SqlValable (table (QGenExpr ctxt be s)) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

val_ :: HaskellLiteralForQExpr (table (QGenExpr ctxt be s)) -> table (QGenExpr ctxt be s) #

(Beamable table, BeamSqlBackend be, FieldsFulfillConstraintNullable (BeamSqlBackendCanSerialize be) table) => SqlValable (table (Nullable (QGenExpr ctxt be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

val_ :: HaskellLiteralForQExpr (table (Nullable (QGenExpr ctxt be s))) -> table (Nullable (QGenExpr ctxt be s)) #

Beamable tbl => ContextRewritable (tbl (QGenExpr old syntax s)) 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type WithRewrittenContext (tbl (QGenExpr old syntax s)) ctxt :: Type #

Methods

rewriteContext :: Proxy ctxt -> tbl (QGenExpr old syntax s) -> WithRewrittenContext (tbl (QGenExpr old syntax s)) ctxt #

Beamable tbl => ContextRewritable (tbl (Nullable (QGenExpr old syntax s))) 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt :: Type #

Methods

rewriteContext :: Proxy ctxt -> tbl (Nullable (QGenExpr old syntax s)) -> WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt #

Beamable tbl => QGroupable (tbl (QExpr be s)) (tbl (QGroupExpr be s))

group_ for any Beamable type. Adds every field in the type to the grouping key. This is the equivalent of including the grouping expression of each field in the type as part of the aggregate projection

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: tbl (QExpr be s) -> tbl (QGroupExpr be s) #

Beamable tbl => QGroupable (tbl (Nullable (QExpr be s))) (tbl (Nullable (QGroupExpr be s)))

group_ for any Beamable type. Adds every field in the type to the grouping key. This is the equivalent of including the grouping expression of each field in the type as part of the aggregate projection

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: tbl (Nullable (QExpr be s)) -> tbl (Nullable (QGroupExpr be s)) #

(Table t, BeamSqlBackend be) => SqlJustable (t (QExpr be s)) (t (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: t (QExpr be s) -> t (Nullable (QExpr be s)) #

nothing_ :: t (Nullable (QExpr be s)) #

BeamSqlBackendHasCustomSyntax be => IsCustomExprFn (CustomSqlSnippet be) (QGenExpr ctxt be s res) 
Instance details

Defined in Database.Beam.Query.CustomSQL

Methods

customExpr_ :: CustomSqlSnippet be -> QGenExpr ctxt be s res #

(Table t, BeamSqlBackend be) => SqlJustable (PrimaryKey t (QExpr be s)) (PrimaryKey t (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: PrimaryKey t (QExpr be s) -> PrimaryKey t (Nullable (QExpr be s)) #

nothing_ :: PrimaryKey t (Nullable (QExpr be s)) #

(IsCustomExprFn a res, BeamSqlBackendHasCustomSyntax be) => IsCustomExprFn (CustomSqlSnippet be -> a) (QGenExpr ctxt be s r -> res) 
Instance details

Defined in Database.Beam.Query.CustomSQL

Methods

customExpr_ :: (CustomSqlSnippet be -> a) -> QGenExpr ctxt be s r -> res #

(BeamSqlBackend be, Beamable tbl, FieldsFulfillConstraint (HasSqlEqualityCheck be) tbl) => SqlEq (QGenExpr context be s) (tbl (QGenExpr context be s))

Compare two arbitrary Beamable types containing QGenExprs for equality.

Instance details

Defined in Database.Beam.Query.Ord

Methods

(==.) :: tbl (QGenExpr context be s) -> tbl (QGenExpr context be s) -> QGenExpr context be s Bool #

(/=.) :: tbl (QGenExpr context be s) -> tbl (QGenExpr context be s) -> QGenExpr context be s Bool #

(==?.) :: tbl (QGenExpr context be s) -> tbl (QGenExpr context be s) -> QGenExpr context be s SqlBool #

(/=?.) :: tbl (QGenExpr context be s) -> tbl (QGenExpr context be s) -> QGenExpr context be s SqlBool #

(BeamSqlBackend be, Beamable tbl, FieldsFulfillConstraintNullable (HasSqlEqualityCheck be) tbl) => SqlEq (QGenExpr context be s) (tbl (Nullable (QGenExpr context be s))) 
Instance details

Defined in Database.Beam.Query.Ord

Methods

(==.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s Bool #

(/=.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s Bool #

(==?.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s SqlBool #

(/=?.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s SqlBool #

QGroupable (QExpr be s a) (QGroupExpr be s a)

group_ for simple value expressions.

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: QExpr be s a -> QGroupExpr be s a #

BeamSqlBackend be => SqlJustable (QExpr be s a) (QExpr be s (Maybe a)) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: QExpr be s a -> QExpr be s (Maybe a) #

nothing_ :: QExpr be s (Maybe a) #

(BeamSqlBackend be, HasSqlQuantifiedEqualityCheck be a) => SqlEqQuantified (QGenExpr context be s) (QQuantified be s a) (QGenExpr context be s a)

Two arbitrary expressions can be quantifiably compared for equality.

Instance details

Defined in Database.Beam.Query.Ord

Methods

(==*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s SqlBool #

(/=*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s SqlBool #

BeamSqlBackend be => SqlOrdQuantified (QGenExpr context be s) (QQuantified be s a) (QGenExpr context be s a) 
Instance details

Defined in Database.Beam.Query.Ord

Methods

(<*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

(>*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

(<=*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

(>=*.) :: QGenExpr context be s a -> QQuantified be s a -> QGenExpr context be s Bool #

(BeamSqlBackend be, HasSqlEqualityCheck be a) => SqlEq (QGenExpr context be s) (QGenExpr context be s a)

Compare two arbitrary expressions (of the same type) for equality

Instance details

Defined in Database.Beam.Query.Ord

Methods

(==.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

(/=.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

(==?.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s SqlBool #

(/=?.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s SqlBool #

BeamSqlBackend be => SqlOrd (QGenExpr context be s) (QGenExpr context be s a) 
Instance details

Defined in Database.Beam.Query.Ord

Methods

(<.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

(>.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

(<=.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

(>=.) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s Bool #

Retaggable (QGenExpr ctxt expr s) (QGenExpr ctxt expr s t) 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type Retag tag (QGenExpr ctxt expr s t) :: Type #

Methods

retag :: (forall a. Columnar' (QGenExpr ctxt expr s) a -> Columnar' (tag (QGenExpr ctxt expr s)) a) -> QGenExpr ctxt expr s t -> Retag tag (QGenExpr ctxt expr s t) #

BeamSqlBackend be => Eq (QGenExpr context be s t) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

(==) :: QGenExpr context be s t -> QGenExpr context be s t -> Bool #

(/=) :: QGenExpr context be s t -> QGenExpr context be s t -> Bool #

(Fractional a, BeamSqlBackend be, BeamSqlBackendCanSerialize be a) => Fractional (QGenExpr context be s a) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

(/) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s a #

recip :: QGenExpr context be s a -> QGenExpr context be s a #

fromRational :: Rational -> QGenExpr context be s a #

(Num a, BeamSqlBackend be, BeamSqlBackendCanSerialize be a) => Num (QGenExpr context be s a) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

(+) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s a #

(-) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s a #

(*) :: QGenExpr context be s a -> QGenExpr context be s a -> QGenExpr context be s a #

negate :: QGenExpr context be s a -> QGenExpr context be s a #

abs :: QGenExpr context be s a -> QGenExpr context be s a #

signum :: QGenExpr context be s a -> QGenExpr context be s a #

fromInteger :: Integer -> QGenExpr context be s a #

(BeamSqlBackend backend, BeamSqlBackendCanSerialize backend [Char]) => IsString (QGenExpr context backend s Text) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

fromString :: String -> QGenExpr context backend s Text #

(BeamSqlBackendCanSerialize be a, BeamSqlBackend be) => SqlValable (QGenExpr ctxt be s a) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

val_ :: HaskellLiteralForQExpr (QGenExpr ctxt be s a) -> QGenExpr ctxt be s a #

ContextRewritable (QGenExpr old syntax s a) 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type WithRewrittenContext (QGenExpr old syntax s a) ctxt :: Type #

Methods

rewriteContext :: Proxy ctxt -> QGenExpr old syntax s a -> WithRewrittenContext (QGenExpr old syntax s a) ctxt #

type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) 
Instance details

Defined in Database.Beam.Query.Internal

type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) = tbl (Nullable (QGenExpr ctxt syntax s'))
type WithRewrittenThread s s' (tbl (QGenExpr ctxt syntax s)) 
Instance details

Defined in Database.Beam.Query.Internal

type WithRewrittenThread s s' (tbl (QGenExpr ctxt syntax s)) = tbl (QGenExpr ctxt syntax s')
type WithRewrittenThread s s' (QGenExpr ctxt syntax s a) 
Instance details

Defined in Database.Beam.Query.Internal

type WithRewrittenThread s s' (QGenExpr ctxt syntax s a) = QGenExpr ctxt syntax s' a
type Retag tag (QGenExpr ctxt expr s t) 
Instance details

Defined in Database.Beam.Query.Internal

type Retag tag (QGenExpr ctxt expr s t) = Columnar (tag (QGenExpr ctxt expr s)) t
type HaskellLiteralForQExpr (table (QGenExpr context be s)) 
Instance details

Defined in Database.Beam.Query.Combinators

type HaskellLiteralForQExpr (table (QGenExpr context be s)) = table Identity
type QExprToIdentity (table (QGenExpr context syntax s)) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (table (QGenExpr context syntax s)) = table Identity
type QExprToField (table (Nullable (QGenExpr context syntax s))) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (table (Nullable (QGenExpr context syntax s))) = table (Nullable (QField s))
type QExprToField (table (QGenExpr context syntax s)) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (table (QGenExpr context syntax s)) = table (QField s)
type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt 
Instance details

Defined in Database.Beam.Query.Internal

type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt = tbl (Nullable (QGenExpr ctxt syntax s))
type WithRewrittenContext (tbl (QGenExpr old syntax s)) ctxt 
Instance details

Defined in Database.Beam.Query.Internal

type WithRewrittenContext (tbl (QGenExpr old syntax s)) ctxt = tbl (QGenExpr ctxt syntax s)
type HaskellLiteralForQExpr (QGenExpr context be s a) 
Instance details

Defined in Database.Beam.Query.Combinators

type HaskellLiteralForQExpr (QGenExpr context be s a) = a
type QExprToIdentity (QGenExpr context syntax s a) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (QGenExpr context syntax s a) = a
type QExprToField (QGenExpr ctxt syntax s a) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (QGenExpr ctxt syntax s a) = QField s a
type WithRewrittenContext (QGenExpr old syntax s a) ctxt 
Instance details

Defined in Database.Beam.Query.Internal

type WithRewrittenContext (QGenExpr old syntax s a) ctxt = QGenExpr ctxt syntax s a

type QExpr = QGenExpr QValueContext #

QGenExprs represent expressions not containing aggregates.

data QWindow be s #

Instances
contextPredicate QWindowFrameContext => ProjectibleWithPredicate contextPredicate be (WithExprContext (BeamSqlBackendWindowFrameSyntax' be)) (QWindow be s) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy contextPredicate -> Proxy (be, WithExprContext (BeamSqlBackendWindowFrameSyntax' be)) -> (forall context. contextPredicate context => Proxy context -> Proxy be -> WithExprContext (BeamSqlBackendWindowFrameSyntax' be) -> m (WithExprContext (BeamSqlBackendWindowFrameSyntax' be))) -> QWindow be s -> m (QWindow be s) #

projectSkeleton' :: Monad m => Proxy contextPredicate -> Proxy (be, WithExprContext (BeamSqlBackendWindowFrameSyntax' be)) -> (forall context. contextPredicate context => Proxy context -> Proxy be -> m (WithExprContext (BeamSqlBackendWindowFrameSyntax' be))) -> m (QWindow be s) #

dbLenses :: (Generic (db (TableLens f db)), Generic (db f), GDatabaseLenses (db f) (Rep (db f)) (Rep (db (TableLens f db)))) => db (TableLens f db) #

Like tableLenses but for types that are instances of Database. Instead of pattern matching on LensFor, pattern match on TableLens.

tableLenses :: (lensType ~ Lenses t f, Generic (t lensType), Generic (t f), GTableLenses t f (Rep (t f)) (Rep (t lensType))) => t (Lenses t f) #

Automatically deduce lenses for a table over any column tag. lenses at global level by doing a top-level pattern match on tableLenses, replacing every column in the pattern with `LensFor nameOfLensForField'. The lenses are generated per-column, not per field in the record. Thus if you have nested Beamable types, lenses are generated for each nested field.

For example,

data AuthorT f = AuthorT
               { _authorEmail     :: Columnar f Text
               , _authorFirstName :: Columnar f Text
               , _authorLastName  :: Columnar f Text }
                 deriving Generic

data BlogPostT f = BlogPost
                 { _blogPostSlug    :: Columnar f Text
                 , _blogPostBody    :: Columnar f Text
                 , _blogPostDate    :: Columnar f UTCTime
                 , _blogPostAuthor  :: PrimaryKey AuthorT f
                 , _blogPostTagline :: Columnar f (Maybe Text) }
                   deriving Generic
instance Table BlogPostT where
   data PrimaryKey BlogPostT f = BlogPostId (Columnar f Text)
   primaryKey = BlogPostId . _blogPostSlug
instance Table AuthorT where
   data PrimaryKey AuthorT f = AuthorId (Columnar f Text)
   primaryKey = AuthorId . _authorEmail
BlogPost (LensFor blogPostSlug
         (LensFor blogPostBody)
         (LensFor blogPostDate)
         (AuthorId (LensFor blogPostAuthorEmail))
         (LensFor blogPostTagLine) = tableLenses

Note: In order to have GHC deduce the right type, you will need to turn off the monomorphism restriction. This is a part of the Haskell standard that specifies that top-level definitions must be inferred to have a monomorphic type. However, lenses need a polymorphic type to work properly. You can turn off the monomorphism restriction by enabling the NoMonomorphismRestriction extension. You can do this per-file by using the {--} pragma at the top of the file. You can also pass the -XNoMonomorphismRestriction command line flag to GHC during compilation.

newtype TableLens (f :: k -> Type) (db :: (k -> Type) -> Type) (x :: k) :: forall k. (k -> Type) -> ((k -> Type) -> Type) -> k -> Type #

Constructors

TableLens (Lens' (db f) (f x)) 
Instances
GDatabaseLenses (db f) (K1 R (f x) :: k1 -> Type) (K1 R (TableLens f db x) :: Type -> Type) 
Instance details

Defined in Database.Beam.Schema.Lenses

Methods

gDatabaseLenses :: Lens' (db f) (K1 R (f x) p) -> K1 R (TableLens f db x) ()

defTblFieldSettings :: (Generic (TableSettings table), GDefaultTableFieldSettings (Rep (TableSettings table) ())) => TableSettings table #

Return a TableSettings for the appropriate table type where each column has been given its default name. See the manual for information on the default naming convention.

pk :: Table t => t f -> PrimaryKey t f #

Synonym for primaryKey

fieldName :: Lens' (TableField table ty) Text #

Van Laarhoven lens to retrieve or set the field name from a TableField.

fieldNamed :: Text -> FieldModification (TableField tbl) a #

A field modification to rename the field. Also offered under the IsString instance for 'FieldModification (TableField tbl) a' for convenience.

modifyTableFields :: tbl (FieldModification (TableField tbl)) -> EntityModification (DatabaseEntity be db) be (TableEntity tbl) #

Construct an EntityModification to rename the fields of a TableEntity

setEntityName :: IsDatabaseEntity be entity => Text -> EntityModification (DatabaseEntity be db) be entity #

Change the entity name without consulting the beam-assigned one

modifyEntityName :: IsDatabaseEntity be entity => (Text -> Text) -> EntityModification (DatabaseEntity be db) be entity #

Construct an EntityModification to rename any database entity

modifyTable :: (Beamable tbl, Table tbl) => (Text -> Text) -> tbl (FieldModification (TableField tbl)) -> EntityModification (DatabaseEntity be db) be (TableEntity tbl) #

Provide an EntityModification for TableEntitys. Allows you to modify the name of the table and provide a modification for each field in the table. See the examples for withDbModification for more.

withTableModification :: Beamable tbl => tbl (FieldModification f) -> tbl f -> tbl f #

Modify a table according to the given field modifications. Invoked by modifyTable to apply the modification in the database. Not used as often in user code, but provided for completeness.

withDbModification :: Database be db => db (entity be db) -> DatabaseModification (entity be db) be db -> db (entity be db) #

Modify a database according to a given modification. Most useful for DatabaseSettings to change the name mappings of tables and fields. For example, you can use this to modify the default names of a table

db :: DatabaseSettings MyDb
db = defaultDbSettings `withDbModification`
     dbModification {
       -- Change default name "table1" to "Table_1". Change the name of "table1Field1" to "first_name"
       table1 = modifyTable (\_ -> "Table_1") (tableModification { table1Field1 = "first_name" }
     }

tableModification :: Beamable tbl => tbl (FieldModification f) #

Return a table modification (for use with modifyTable) that does nothing. Useful if you only want to change the table name, or if you only want to modify a few fields.

For example,

tableModification { field1 = "Column1" }

is a table modification (where 'f ~ TableField tbl') that changes the column name of field1 to Column1.

dbModification :: Database be db => DatabaseModification f be db #

Return a DatabaseModification that does nothing. This is useful if you only want to rename one table. You can do

dbModification { tbl1 = modifyTable (\oldNm -> "NewTableName") tableModification }

defaultDbSettings :: (Generic (DatabaseSettings be db), GAutoDbSettings (Rep (DatabaseSettings be db) ())) => DatabaseSettings be db #

Automatically provide names for tables, and descriptions for tables (using defTblFieldSettings). Your database must implement Generic, and must be auto-derivable. For more information on name generation, see the manual

class Database be (db :: (Type -> Type) -> Type) #

Allows introspection into database types.

All database types must be of kind '(* -> *) -> *'. If the type parameter is named f, each field must be of the type of f applied to some type for which an IsDatabaseEntity instance exists.

The be type parameter is necessary so that the compiler can ensure that backend-specific entities only work on the proper backend.

Entities are documented under the corresponding section and in the manual

Instances
Database be Db Source # 
Instance details

Defined in TsWeb.Tables.Session.Test

Methods

zipTables :: Monad m => Proxy be -> (forall tbl. (IsDatabaseEntity be tbl, DatabaseEntityRegularRequirements be tbl) => f tbl -> g tbl -> m (h tbl)) -> Db f -> Db g -> m (Db h) #

type DatabaseModification (f :: Type -> Type) be (db :: (Type -> Type) -> Type) = db (EntityModification f be) #

A helper data type that lets you modify a database schema. Converts all entities in the database into functions from that entity to itself.

data EntityModification (f :: Type -> Type) be e #

A newtype wrapper around 'f e -> f e' (i.e., an endomorphism between entity types in f). You usually want to use modifyTable or another function to contstruct these for you.

Instances
Database be db => RenamableWithRule (db (EntityModification (DatabaseEntity be db) be)) 
Instance details

Defined in Database.Beam.Schema.Tables

Semigroup (EntityModification f be e) 
Instance details

Defined in Database.Beam.Schema.Tables

Monoid (EntityModification f be e) 
Instance details

Defined in Database.Beam.Schema.Tables

IsDatabaseEntity be entity => RenamableWithRule (EntityModification (DatabaseEntity be db) be entity) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

renamingFields :: (NonEmpty Text -> Text) -> EntityModification (DatabaseEntity be db) be entity #

data FieldModification (f :: Type -> Type) a #

A newtype wrapper around 'Columnar f a -> Columnar f ' (i.e., an endomorphism between Columnars over f). You usually want to use fieldNamed or the IsString instance to rename the field, when 'f ~ TableField'

Instances
(Beamable tbl, RenamableField f) => RenamableWithRule (tbl (FieldModification f)) 
Instance details

Defined in Database.Beam.Schema.Tables

IsString (FieldModification (TableField tbl) a) 
Instance details

Defined in Database.Beam.Schema.Tables

data TableEntity (tbl :: (Type -> Type) -> Type) #

An entity tag for tables. See the documentation for Table or consult the manual for more.

Instances
Beamable tbl => IsDatabaseEntity be (TableEntity tbl) 
Instance details

Defined in Database.Beam.Schema.Tables

Beamable tbl => IsCheckedDatabaseEntity be (TableEntity tbl) 
Instance details

Defined in Database.Beam.Migrate.Types.CheckedEntities

Beamable tbl => RenamableWithRule (FieldRenamer (DatabaseEntityDescriptor be (TableEntity tbl))) 
Instance details

Defined in Database.Beam.Schema.Tables

type DatabaseEntityRegularRequirements be (TableEntity tbl) 
Instance details

Defined in Database.Beam.Schema.Tables

type DatabaseEntityDefaultRequirements be (TableEntity tbl) 
Instance details

Defined in Database.Beam.Schema.Tables

type DatabaseEntityDefaultRequirements be (TableEntity tbl) = (GDefaultTableFieldSettings (Rep (TableSettings tbl) ()), Generic (TableSettings tbl), Table tbl, Beamable tbl)
data DatabaseEntityDescriptor be (TableEntity tbl) 
Instance details

Defined in Database.Beam.Schema.Tables

data DatabaseEntityDescriptor be (TableEntity tbl) where
type CheckedDatabaseEntityDefaultRequirements be (TableEntity tbl) 
Instance details

Defined in Database.Beam.Migrate.Types.CheckedEntities

type CheckedDatabaseEntityDefaultRequirements be (TableEntity tbl) = (DatabaseEntityDefaultRequirements be (TableEntity tbl), Generic (tbl (Const [FieldCheck] :: Type -> Type)), GMigratableTableSettings be (Rep (tbl Identity)) (Rep (tbl (Const [FieldCheck] :: Type -> Type))), BeamSqlBackend be)
data CheckedDatabaseEntityDescriptor be (TableEntity tbl) 
Instance details

Defined in Database.Beam.Migrate.Types.CheckedEntities

data DatabaseEntity be (db :: (Type -> Type) -> Type) entityType #

Represents a meta-description of a particular entityType. Mostly, a wrapper around 'DatabaseEntityDescriptor be entityType', but carries around the IsDatabaseEntity dictionary.

Instances
Database be db => RenamableWithRule (db (EntityModification (DatabaseEntity be db) be)) 
Instance details

Defined in Database.Beam.Schema.Tables

IsDatabaseEntity be entity => RenamableWithRule (EntityModification (DatabaseEntity be db) be entity) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

renamingFields :: (NonEmpty Text -> Text) -> EntityModification (DatabaseEntity be db) be entity #

(Selector f, IsDatabaseEntity be x, DatabaseEntityDefaultRequirements be x) => GAutoDbSettings (S1 f (K1 R (DatabaseEntity be db x) :: Type -> Type) p) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

autoDbSettings' :: S1 f (K1 R (DatabaseEntity be db x)) p

type DatabaseSettings be (db :: (Type -> Type) -> Type) = db (DatabaseEntity be db) #

When parameterized by this entity tag, a database type will hold meta-information on the Haskell mappings of database entities. Under the hood, each entity type is transformed into its DatabaseEntityDescriptor type. For tables this includes the table name as well as the corresponding TableSettings, which provides names for each column.

data Lenses (t :: (Type -> Type) -> Type) (f :: Type -> Type) x #

Instances
(Generic (sub m), Generic (sub (Lenses t m)), GTableLenses t m (Rep (sub m)) (Rep (sub (Lenses t m)))) => GTableLenses t m (K1 R (sub m) :: k -> Type) (K1 R (sub (Lenses t m)) :: Type -> Type) 
Instance details

Defined in Database.Beam.Schema.Lenses

Methods

gTableLenses :: Proxy (K1 R (sub m)) -> Lens' (t m) (K1 R (sub m) p) -> K1 R (sub (Lenses t m)) ()

(Generic (sub (Nullable m)), Generic (sub (Nullable (Lenses t m))), GTableLenses t m (Rep (sub (Nullable m))) (Rep (sub (Nullable (Lenses t m))))) => GTableLenses t m (K1 R (sub (Nullable m)) :: k -> Type) (K1 R (sub (Nullable (Lenses t m))) :: Type -> Type) 
Instance details

Defined in Database.Beam.Schema.Lenses

Methods

gTableLenses :: Proxy (K1 R (sub (Nullable m))) -> Lens' (t m) (K1 R (sub (Nullable m)) p) -> K1 R (sub (Nullable (Lenses t m))) ()

data LensFor t x where #

Constructors

LensFor :: forall t x. Generic t => Lens' t x -> LensFor t x 
Instances
Generic (t m) => GTableLenses t m (K1 R x :: k -> Type) (K1 R (LensFor (t m) x) :: Type -> Type) 
Instance details

Defined in Database.Beam.Schema.Lenses

Methods

gTableLenses :: Proxy (K1 R x) -> Lens' (t m) (K1 R x p) -> K1 R (LensFor (t m) x) ()

type family Columnar (f :: Type -> Type) x :: Type where ... #

A type family that we use to "tag" columns in our table datatypes.

This is what allows us to use the same table type to hold table data, describe table settings, derive lenses, and provide expressions.

The basic rules are

Columnar Identity x = x

Thus, any Beam table applied to Identity will yield a simplified version of the data type, that contains just what you'd expect.

The Nullable type is used when referencing PrimaryKeys that we want to include optionally. For example, if we have a table with a PrimaryKey, like the following

data BeamTableT f = BeamTableT
                  { _refToAnotherTable :: PrimaryKey AnotherTableT f
                  , ... }

we would typically be required to provide values for the PrimaryKey embedded into BeamTableT. We can use Nullable to lift this constraint.

data BeamTableT f = BeamTableT
                  { _refToAnotherTable :: PrimaryKey AnotherTableT (Nullable f)
                  , ... }

Now we can use justRef and nothingRef to refer to this table optionally. The embedded PrimaryKey in _refToAnotherTable automatically has its fields converted into Maybe using Nullable.

The last Columnar rule is

Columnar f x = f x

Use this rule if you'd like to parameterize your table type over any other functor. For example, this is used in the query modules to write expressions such as 'TableT QExpr', which returns a table whose fields have been turned into query expressions.

The other rules are used within Beam to provide lenses and to expose the inner structure of the data type.

Equations

Columnar Exposed x = Exposed x 
Columnar Identity x = x 
Columnar (Lenses t f) x = LensFor (t f) (Columnar f x) 
Columnar (Nullable c) x = Columnar c (Maybe x) 
Columnar f x = f x 

type C (f :: Type -> Type) a = Columnar f a #

A short type-alias for Columnar. May shorten your schema definitions

data Columnar' (f :: Type -> Type) a #

If you declare a function 'Columnar f a -> b' and try to constrain your function by a type class for f, GHC will complain, because f is ambiguous in 'Columnar f a'. For example, 'Columnar Identity (Maybe a) ~ Maybe a' and 'Columnar (Nullable Identity) a ~ Maybe a', so given a type 'Columnar f a', we cannot know the type of f.

Thus, if you need to know f, you can instead use Columnar'. Since its a newtype, it carries around the f paramater unambiguously. Internally, it simply wraps 'Columnar f a'

data TableField (table :: (Type -> Type) -> Type) ty #

Metadata for a field of type ty in table.

Essentially a wrapper over the field name, but with a phantom type parameter, so that it forms an appropriate column tag.

Usually you use the defaultDbSettings function to generate an appropriate naming convention for you, and then modify it with withDbModification if necessary. Under this scheme, the field n be renamed using the IsString instance for TableField, or the fieldNamed function.

Instances
RenamableField (TableField tbl) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

renameField :: Proxy (TableField tbl) -> Proxy a -> (NonEmpty Text -> Text) -> Columnar (TableField tbl) a -> Columnar (TableField tbl) a #

TagReducesTo (TableField tbl) (TableField tbl) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

reduceTag :: Functor m => (Columnar' (TableField tbl) a' -> m (Columnar' (TableField tbl) a')) -> Columnar' (TableField tbl) a -> m (Columnar' (TableField tbl) a) #

Eq (TableField table ty) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

(==) :: TableField table ty -> TableField table ty -> Bool #

(/=) :: TableField table ty -> TableField table ty -> Bool #

Show (TableField table ty) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

showsPrec :: Int -> TableField table ty -> ShowS #

show :: TableField table ty -> String #

showList :: [TableField table ty] -> ShowS #

IsString (FieldModification (TableField tbl) a) 
Instance details

Defined in Database.Beam.Schema.Tables

Selector f => GDefaultTableFieldSettings (S1 f (K1 R (TableField table field) :: Type -> Type) p) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

gDefTblFieldSettings :: Proxy (S1 f (K1 R (TableField table field)) p) -> S1 f (K1 R (TableField table field)) p

type TableSettings (table :: (Type -> Type) -> Type) = table (TableField table) #

Represents a table that contains metadata on its fields. In particular, each field of type 'Columnar f a' is transformed into 'TableField table a'. You can get or update the name of each field by using the fieldName lens.

type HaskellTable (table :: (Type -> Type) -> Type) = table Identity #

The regular Haskell version of the table. Equivalent to 'tbl Identity'

class (Typeable table, Beamable table, Beamable (PrimaryKey table)) => Table (table :: (Type -> Type) -> Type) where #

The big Kahuna! All beam tables implement this class.

The kind of all table types is '(* -> *) -> *'. This is because all table types are actually table type constructors. Every table type takes in another type constructor, called the column tag, and uses that constructor to instantiate the column types. See the documentation for Columnar.

This class is mostly Generic-derivable. You need only specify a type for the table's primary key and a method to extract the primary key given the table.

An example table:

data BlogPostT f = BlogPost
                 { _blogPostSlug    :: Columnar f Text
                 , _blogPostBody    :: Columnar f Text
                 , _blogPostDate    :: Columnar f UTCTime
                 , _blogPostAuthor  :: PrimaryKey AuthorT f
                 , _blogPostTagline :: Columnar f (Maybe Text)
                 , _blogPostImageGallery :: PrimaryKey ImageGalleryT (Nullable f) }
                   deriving Generic
instance Beamable BlogPostT
instance Table BlogPostT where
   data PrimaryKey BlogPostT f = BlogPostId (Columnar f Text) deriving Generic
   primaryKey = BlogPostId . _blogPostSlug
instance Beamable (PrimaryKey BlogPostT)

We can interpret this as follows:

  • The _blogPostSlug, _blogPostBody, _blogPostDate, and _blogPostTagline fields are of types ErrorMessage, ErrorMessage, UTCTime, and 'Maybe Text' respectfully.
  • Since _blogPostSlug, _blogPostBody, _blogPostDate, _blogPostAuthor must be provided (i.e, they cannot contain Nothing), they will be given SQL NOT NULL constraints. _blogPostTagline is declared Maybe so Nothing will be stored as NULL in the database. _blogPostImageGallery will be allowed to be empty because it uses the Nullable tag modifier.
  • blogPostAuthor references the AuthorT table (not given here) and is required.
  • blogPostImageGallery references the ImageGalleryT table (not given here), but this relation is not required (i.e., it may be Nothing. See Nullable).

Associated Types

data PrimaryKey (table :: (Type -> Type) -> Type) (column :: Type -> Type) :: Type #

A data type representing the types of primary keys for this table. In order to play nicely with the default deriving mechanism, this type must be an instance of Generic.

Methods

primaryKey :: table column -> PrimaryKey table column #

Given a table, this should return the PrimaryKey from the table. By keeping this polymorphic over column, we ensure that the primary key values come directly from the table (i.e., they can't be arbitrary constants)

Instances
(Beamable d, Typeable d) => Table (SessionT d) Source # 
Instance details

Defined in TsWeb.Tables.Session

Associated Types

data PrimaryKey (SessionT d) column :: Type #

Methods

primaryKey :: SessionT d column -> PrimaryKey (SessionT d) column #

class Beamable (table :: (Type -> Type) -> Type) #

Provides a number of introspection routines for the beam library. Allows us to "zip" tables with different column tags together. Always instantiate an empty Beamable instance for tables, primary keys, and any type that you would like to embed within either. See the manual for more information on embedding.

Instances
Beamable PgJSONKey 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Methods

zipBeamFieldsM :: Applicative m => (forall a. Columnar' f a -> Columnar' g a -> m (Columnar' h a)) -> PgJSONKey f -> PgJSONKey g -> m (PgJSONKey h) #

tblSkeleton :: TableSkeleton PgJSONKey #

Beamable UsersMixin Source # 
Instance details

Defined in TsWeb.Tables.Session.Test

Methods

zipBeamFieldsM :: Applicative m => (forall a. Columnar' f a -> Columnar' g a -> m (Columnar' h a)) -> UsersMixin f -> UsersMixin g -> m (UsersMixin h) #

tblSkeleton :: TableSkeleton UsersMixin #

Beamable (PrimaryKey (SessionT d)) Source # 
Instance details

Defined in TsWeb.Tables.Session

Methods

zipBeamFieldsM :: Applicative m => (forall a. Columnar' f a -> Columnar' g a -> m (Columnar' h a)) -> PrimaryKey (SessionT d) f -> PrimaryKey (SessionT d) g -> m (PrimaryKey (SessionT d) h) #

tblSkeleton :: TableSkeleton (PrimaryKey (SessionT d)) #

Beamable (PgJSONEach valType) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Methods

zipBeamFieldsM :: Applicative m => (forall a. Columnar' f a -> Columnar' g a -> m (Columnar' h a)) -> PgJSONEach valType f -> PgJSONEach valType g -> m (PgJSONEach valType h) #

tblSkeleton :: TableSkeleton (PgJSONEach valType) #

Beamable (PgJSONElement a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Methods

zipBeamFieldsM :: Applicative m => (forall a0. Columnar' f a0 -> Columnar' g a0 -> m (Columnar' h a0)) -> PgJSONElement a f -> PgJSONElement a g -> m (PgJSONElement a h) #

tblSkeleton :: TableSkeleton (PgJSONElement a) #

Beamable d => Beamable (SessionT d) Source # 
Instance details

Defined in TsWeb.Tables.Session

Methods

zipBeamFieldsM :: Applicative m => (forall a. Columnar' f a -> Columnar' g a -> m (Columnar' h a)) -> SessionT d f -> SessionT d g -> m (SessionT d h) #

tblSkeleton :: TableSkeleton (SessionT d) #

Beamable (PgUnnestArrayTbl a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Methods

zipBeamFieldsM :: Applicative m => (forall a0. Columnar' f a0 -> Columnar' g a0 -> m (Columnar' h a0)) -> PgUnnestArrayTbl a f -> PgUnnestArrayTbl a g -> m (PgUnnestArrayTbl a h) #

tblSkeleton :: TableSkeleton (PgUnnestArrayTbl a) #

Beamable (PgUnnestArrayWithOrdinalityTbl a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

Methods

zipBeamFieldsM :: Applicative m => (forall a0. Columnar' f a0 -> Columnar' g a0 -> m (Columnar' h a0)) -> PgUnnestArrayWithOrdinalityTbl a f -> PgUnnestArrayWithOrdinalityTbl a g -> m (PgUnnestArrayWithOrdinalityTbl a h) #

tblSkeleton :: TableSkeleton (PgUnnestArrayWithOrdinalityTbl a) #

class (BeamBackend be, Monad m) => MonadBeam be (m :: Type -> Type) | m -> be where #

A class that ties together a monad with a particular backend

Provided here is a low-level interface for executing commands. The 'run*' functions are wrapped by the appropriate functions in Query.

This interface is very high-level and isn't meant to expose the full power of the underlying database. Namely, it only supports simple data retrieval strategies. More complicated strategies (for example, Postgres's COPY) are supported in individual backends. See the documentation of those backends for more details.

Minimal complete definition

runReturningMany

Methods

runReturningMany #

Arguments

:: FromBackendRow be x 
=> BeamSqlBackendSyntax be

The query to run

-> (m (Maybe x) -> m a)

Reader action that will be called with a function to fetch the next row

-> m a 

Run a query determined by the given syntax, providing an action that will be called to consume the results from the database (if any). The action will get a reader action that can be used to fetch the next row. When this reader action returns Nothing, there are no rows left to consume. When the reader action returns, the database result is freed.

runNoReturn :: BeamSqlBackendSyntax be -> m () #

Run the given command and don't consume any results. Useful for DML statements like INSERT, UPDATE, and DELETE, or DDL statements.

runReturningOne :: FromBackendRow be x => BeamSqlBackendSyntax be -> m (Maybe x) #

Run the given command and fetch the unique result. The result is Nothing if either no results are returned or more than one result is returned.

runReturningList :: FromBackendRow be x => BeamSqlBackendSyntax be -> m [x] #

Run the given command, collect all the results, and return them as a list. May be more convenient than runReturningMany, but reads the entire result set into memory.

Instances
MonadBeam Postgres Pg 
Instance details

Defined in Database.Beam.Postgres.Connection

(MonadBeam be m, Monoid s) => MonadBeam be (WriterT s m) 
Instance details

Defined in Database.Beam.Backend.SQL

(MonadBeam be m, Monoid s) => MonadBeam be (WriterT s m) 
Instance details

Defined in Database.Beam.Backend.SQL

MonadBeam be m => MonadBeam be (StateT s m) 
Instance details

Defined in Database.Beam.Backend.SQL

MonadBeam be m => MonadBeam be (StateT s m) 
Instance details

Defined in Database.Beam.Backend.SQL

MonadBeam be m => MonadBeam be (ExceptT e m) 
Instance details

Defined in Database.Beam.Backend.SQL

MonadBeam be m => MonadBeam be (ReaderT r m) 
Instance details

Defined in Database.Beam.Backend.SQL

MonadBeam be m => MonadBeam be (ContT r m) 
Instance details

Defined in Database.Beam.Backend.SQL

(MonadBeam be m, Monoid w) => MonadBeam be (RWST r w s m) 
Instance details

Defined in Database.Beam.Backend.SQL

Methods

runReturningMany :: FromBackendRow be x => BeamSqlBackendSyntax be -> (RWST r w s m (Maybe x) -> RWST r w s m a) -> RWST r w s m a #

runNoReturn :: BeamSqlBackendSyntax be -> RWST r w s m () #

runReturningOne :: FromBackendRow be x => BeamSqlBackendSyntax be -> RWST r w s m (Maybe x) #

runReturningList :: FromBackendRow be x => BeamSqlBackendSyntax be -> RWST r w s m [x] #

(MonadBeam be m, Monoid w) => MonadBeam be (RWST r w s m) 
Instance details

Defined in Database.Beam.Backend.SQL

Methods

runReturningMany :: FromBackendRow be x => BeamSqlBackendSyntax be -> (RWST r w s m (Maybe x) -> RWST r w s m a) -> RWST r w s m a #

runNoReturn :: BeamSqlBackendSyntax be -> RWST r w s m () #

runReturningOne :: FromBackendRow be x => BeamSqlBackendSyntax be -> RWST r w s m (Maybe x) #

runReturningList :: FromBackendRow be x => BeamSqlBackendSyntax be -> RWST r w s m [x] #

class BeamBackend be => FromBackendRow be a where #

Minimal complete definition

Nothing

Methods

fromBackendRow :: FromBackendRowM be a #

Parses a beam row. This should not fail, except in the case of an internal bug in beam deserialization code. If it does fail, this should throw a BeamRowParseError.

valuesNeeded :: Proxy be -> Proxy a -> Int #

Instances
BeamBackend be => FromBackendRow be () 
Instance details

Defined in Database.Beam.Backend.SQL.Row

FromBackendRow Postgres Bool 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Char 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Double 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Int 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Int16 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Int32 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Int64 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Integer 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Word 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Word16 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Word32 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Word64 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Text 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres ByteString 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres ByteString 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Scientific 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres UTCTime 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Value 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Text 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres SqlNull 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres TsVector 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

FromBackendRow Postgres TsQuery 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

FromBackendRow Postgres PgMoney 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

FromBackendRow Postgres PgPoint 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

FromBackendRow Postgres PgBox 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

FromBackendRow Postgres Oid 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres HStoreList 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres HStoreMap 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Null 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres LocalTimestamp 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres UTCTimestamp 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres ZonedTimestamp 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Date 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres LocalTime 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres TimeOfDay 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres Day 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres UUID 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres PgRawString 
Instance details

Defined in Database.Beam.Postgres.CustomTypes

Methods

fromBackendRow :: FromBackendRowM Postgres PgRawString #

valuesNeeded :: Proxy Postgres -> Proxy PgRawString -> Int #

(BeamBackend be, Generic (tbl Identity), Generic (tbl Exposed), GFromBackendRow be (Rep (tbl Exposed)) (Rep (tbl Identity))) => FromBackendRow be (tbl Identity) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

(BeamBackend be, Generic (tbl (Nullable Identity)), Generic (tbl (Nullable Exposed)), GFromBackendRow be (Rep (tbl (Nullable Exposed))) (Rep (tbl (Nullable Identity)))) => FromBackendRow be (tbl (Nullable Identity)) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

FromBackendRow be x => FromBackendRow be (SqlSerial x) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

(FromBackendRow be x, FromBackendRow be SqlNull) => FromBackendRow be (Maybe x) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

FromBackendRow Postgres [Char] 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres (Ratio Integer) 
Instance details

Defined in Database.Beam.Postgres.Types

(Typeable a, FromJSON a) => FromBackendRow Postgres (PgJSON a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

(Typeable a, FromJSON a) => FromBackendRow Postgres (PgJSONB a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

FromBackendRow Postgres (CI Text) 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres (CI Text) 
Instance details

Defined in Database.Beam.Postgres.Types

(FromField a, Typeable a) => FromBackendRow Postgres (PGRange a) 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres (Binary ByteString) 
Instance details

Defined in Database.Beam.Postgres.Types

FromBackendRow Postgres (Binary ByteString) 
Instance details

Defined in Database.Beam.Postgres.Types

(FromField a, Typeable a) => FromBackendRow Postgres (PGArray a) 
Instance details

Defined in Database.Beam.Postgres.Types

(FromField a, Typeable a) => FromBackendRow Postgres (Vector a) 
Instance details

Defined in Database.Beam.Postgres.Types

(BeamBackend be, KnownNat n, FromBackendRow be a) => FromBackendRow be (Vector n a) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

(BeamBackend be, FromBackendRow be a, FromBackendRow be b) => FromBackendRow be (a, b) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

Methods

fromBackendRow :: FromBackendRowM be (a, b) #

valuesNeeded :: Proxy be -> Proxy (a, b) -> Int #

(FromField a, FromField b, Typeable a, Typeable b) => FromBackendRow Postgres (Either a b) 
Instance details

Defined in Database.Beam.Postgres.Types

(FromField a, Typeable a, Typeable n, Ord a) => FromBackendRow Postgres (PgRange n a) 
Instance details

Defined in Database.Beam.Postgres.PgSpecific

(BeamBackend be, FromBackendRow be t) => FromBackendRow be (Tagged tag t) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

Methods

fromBackendRow :: FromBackendRowM be (Tagged tag t) #

valuesNeeded :: Proxy be -> Proxy (Tagged tag t) -> Int #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c) => FromBackendRow be (a, b, c) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

Methods

fromBackendRow :: FromBackendRowM be (a, b, c) #

valuesNeeded :: Proxy be -> Proxy (a, b, c) -> Int #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c, FromBackendRow be d) => FromBackendRow be (a, b, c, d) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

Methods

fromBackendRow :: FromBackendRowM be (a, b, c, d) #

valuesNeeded :: Proxy be -> Proxy (a, b, c, d) -> Int #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c, FromBackendRow be d, FromBackendRow be e) => FromBackendRow be (a, b, c, d, e) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

Methods

fromBackendRow :: FromBackendRowM be (a, b, c, d, e) #

valuesNeeded :: Proxy be -> Proxy (a, b, c, d, e) -> Int #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c, FromBackendRow be d, FromBackendRow be e, FromBackendRow be f) => FromBackendRow be (a, b, c, d, e, f) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

Methods

fromBackendRow :: FromBackendRowM be (a, b, c, d, e, f) #

valuesNeeded :: Proxy be -> Proxy (a, b, c, d, e, f) -> Int #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c, FromBackendRow be d, FromBackendRow be e, FromBackendRow be f, FromBackendRow be g) => FromBackendRow be (a, b, c, d, e, f, g) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

Methods

fromBackendRow :: FromBackendRowM be (a, b, c, d, e, f, g) #

valuesNeeded :: Proxy be -> Proxy (a, b, c, d, e, f, g) -> Int #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c, FromBackendRow be d, FromBackendRow be e, FromBackendRow be f, FromBackendRow be g, FromBackendRow be h) => FromBackendRow be (a, b, c, d, e, f, g, h) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

Methods

fromBackendRow :: FromBackendRowM be (a, b, c, d, e, f, g, h) #

valuesNeeded :: Proxy be -> Proxy (a, b, c, d, e, f, g, h) -> Int #

data Nullable (c :: Type -> Type) x #

Support for NULLable Foreign Key references.

data MyTable f = MyTable
               { nullableRef :: PrimaryKey AnotherTable (Nullable f)
               , ... }
                deriving (Generic, Typeable)

See Columnar for more information.

Instances
Beamable t => ProjectibleWithPredicate AnyType () Text (t (Nullable (QField s))) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy AnyType -> Proxy ((), Text) -> (forall context. AnyType context => Proxy context -> Proxy () -> Text -> m Text) -> t (Nullable (QField s)) -> m (t (Nullable (QField s))) #

projectSkeleton' :: Monad m => Proxy AnyType -> Proxy ((), Text) -> (forall context. AnyType context => Proxy context -> Proxy () -> m Text) -> m (t (Nullable (QField s))) #

Beamable t => ProjectibleWithPredicate AnyType () Text (t (Nullable (Const Text :: Type -> Type))) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy AnyType -> Proxy ((), Text) -> (forall context. AnyType context => Proxy context -> Proxy () -> Text -> m Text) -> t (Nullable (Const Text)) -> m (t (Nullable (Const Text))) #

projectSkeleton' :: Monad m => Proxy AnyType -> Proxy ((), Text) -> (forall context. AnyType context => Proxy context -> Proxy () -> m Text) -> m (t (Nullable (Const Text))) #

(Generic (sub (Nullable m)), Generic (sub (Nullable (Lenses t m))), GTableLenses t m (Rep (sub (Nullable m))) (Rep (sub (Nullable (Lenses t m))))) => GTableLenses t m (K1 R (sub (Nullable m)) :: k -> Type) (K1 R (sub (Nullable (Lenses t m))) :: Type -> Type) 
Instance details

Defined in Database.Beam.Schema.Lenses

Methods

gTableLenses :: Proxy (K1 R (sub (Nullable m))) -> Lens' (t m) (K1 R (sub (Nullable m)) p) -> K1 R (sub (Nullable (Lenses t m))) ()

Beamable tbl => GZipTables f g h (K1 R (tbl (Nullable Exposed)) :: Type -> Type) (K1 R (tbl (Nullable f)) :: Type -> Type) (K1 R (tbl (Nullable g)) :: Type -> Type) (K1 R (tbl (Nullable h)) :: Type -> Type) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

gZipTables :: Applicative m => Proxy (K1 R (tbl (Nullable Exposed))) -> (forall a. Columnar' f a -> Columnar' g a -> m (Columnar' h a)) -> K1 R (tbl (Nullable f)) () -> K1 R (tbl (Nullable g)) () -> m (K1 R (tbl (Nullable h)) ())

(Beamable t, contextPredicate context) => ProjectibleWithPredicate contextPredicate be (WithExprContext (BeamSqlBackendExpressionSyntax' be)) (t (Nullable (QGenExpr context be s))) 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy contextPredicate -> Proxy (be, WithExprContext (BeamSqlBackendExpressionSyntax' be)) -> (forall context0. contextPredicate context0 => Proxy context0 -> Proxy be -> WithExprContext (BeamSqlBackendExpressionSyntax' be) -> m (WithExprContext (BeamSqlBackendExpressionSyntax' be))) -> t (Nullable (QGenExpr context be s)) -> m (t (Nullable (QGenExpr context be s))) #

projectSkeleton' :: Monad m => Proxy contextPredicate -> Proxy (be, WithExprContext (BeamSqlBackendExpressionSyntax' be)) -> (forall context0. contextPredicate context0 => Proxy context0 -> Proxy be -> m (WithExprContext (BeamSqlBackendExpressionSyntax' be))) -> m (t (Nullable (QGenExpr context be s))) #

(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (Nullable (QField s))) (tbl (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

(<-.) :: tbl (Nullable (QField s)) -> tbl (Nullable (QExpr be s)) -> QAssignment be s #

Beamable tbl => ThreadRewritable s (tbl (Nullable (QGenExpr ctxt syntax s))) 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) :: Type #

Methods

rewriteThread :: Proxy s' -> tbl (Nullable (QGenExpr ctxt syntax s)) -> WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) #

(BeamBackend be, Generic (tbl (Nullable Identity)), Generic (tbl (Nullable Exposed)), GFromBackendRow be (Rep (tbl (Nullable Exposed))) (Rep (tbl (Nullable Identity)))) => FromBackendRow be (tbl (Nullable Identity)) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

(BeamSqlBackend be, Beamable t) => SqlDeconstructMaybe be (t (Nullable (QGenExpr ctxt be s))) (t (QGenExpr ctxt be s)) s 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

isJust_ :: t (Nullable (QGenExpr ctxt be s)) -> QGenExpr ctxt0 be s Bool #

isNothing_ :: t (Nullable (QGenExpr ctxt be s)) -> QGenExpr ctxt0 be s Bool #

maybe_ :: QGenExpr ctxt0 be s y -> (t (QGenExpr ctxt be s) -> QGenExpr ctxt0 be s y) -> t (Nullable (QGenExpr ctxt be s)) -> QGenExpr ctxt0 be s y #

FromBackendRow be (t (Nullable Identity)) => GFromBackendRow be (K1 R (t (Nullable Exposed)) :: Type -> Type) (K1 R (t (Nullable Identity)) :: Type -> Type) 
Instance details

Defined in Database.Beam.Backend.SQL.Row

FieldsFulfillConstraintNullable c t => GFieldsFulfillConstraint c (K1 R (t (Nullable Exposed)) :: Type -> Type) (K1 R (t (Nullable Identity)) :: Type -> Type) (K1 R (t (Nullable (WithConstraint c))) :: Type -> Type) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

gWithConstrainedFields :: Proxy c -> Proxy (K1 R (t (Nullable Exposed))) -> K1 R (t (Nullable Identity)) () -> K1 R (t (Nullable (WithConstraint c))) () #

(Beamable table, BeamSqlBackend be, FieldsFulfillConstraintNullable (BeamSqlBackendCanSerialize be) table) => SqlValable (table (Nullable (QGenExpr ctxt be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

val_ :: HaskellLiteralForQExpr (table (Nullable (QGenExpr ctxt be s))) -> table (Nullable (QGenExpr ctxt be s)) #

Beamable tbl => ContextRewritable (tbl (Nullable (QGenExpr old syntax s))) 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt :: Type #

Methods

rewriteContext :: Proxy ctxt -> tbl (Nullable (QGenExpr old syntax s)) -> WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt #

TagReducesTo f f' => TagReducesTo (Nullable f) f' 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

reduceTag :: Functor m => (Columnar' f' a' -> m (Columnar' f' a')) -> Columnar' (Nullable f) a -> m (Columnar' (Nullable f) a) #

Beamable tbl => QGroupable (tbl (Nullable (QExpr be s))) (tbl (Nullable (QGroupExpr be s)))

group_ for any Beamable type. Adds every field in the type to the grouping key. This is the equivalent of including the grouping expression of each field in the type as part of the aggregate projection

Instance details

Defined in Database.Beam.Query.Aggregate

Methods

group_ :: tbl (Nullable (QExpr be s)) -> tbl (Nullable (QGroupExpr be s)) #

(Table t, BeamSqlBackend be) => SqlJustable (t (QExpr be s)) (t (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: t (QExpr be s) -> t (Nullable (QExpr be s)) #

nothing_ :: t (Nullable (QExpr be s)) #

Table t => SqlJustable (t Identity) (t (Nullable Identity)) 
Instance details

Defined in Database.Beam.Query.Combinators

(Table t, BeamSqlBackend be) => SqlJustable (PrimaryKey t (QExpr be s)) (PrimaryKey t (Nullable (QExpr be s))) 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: PrimaryKey t (QExpr be s) -> PrimaryKey t (Nullable (QExpr be s)) #

nothing_ :: PrimaryKey t (Nullable (QExpr be s)) #

Table t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity)) 
Instance details

Defined in Database.Beam.Query.Combinators

Beamable tbl => GTableSkeleton (K1 R (tbl (Nullable Ignored)) :: Type -> Type) 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

gTblSkeleton :: Proxy (K1 R (tbl (Nullable Ignored))) -> K1 R (tbl (Nullable Ignored)) ()

(BeamSqlBackend be, Beamable tbl, FieldsFulfillConstraintNullable (HasSqlEqualityCheck be) tbl) => SqlEq (QGenExpr context be s) (tbl (Nullable (QGenExpr context be s))) 
Instance details

Defined in Database.Beam.Query.Ord

Methods

(==.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s Bool #

(/=.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s Bool #

(==?.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s SqlBool #

(/=?.) :: tbl (Nullable (QGenExpr context be s)) -> tbl (Nullable (QGenExpr context be s)) -> QGenExpr context be s SqlBool #

type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) 
Instance details

Defined in Database.Beam.Query.Internal

type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) = tbl (Nullable (QGenExpr ctxt syntax s'))
type HaskellLiteralForQExpr (table (Nullable f)) 
Instance details

Defined in Database.Beam.Query.Combinators

type HaskellLiteralForQExpr (table (Nullable f)) = HaskellLiteralForQExpr_AddNullable (HaskellLiteralForQExpr (table f))
type QExprToIdentity (table (Nullable c)) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (table (Nullable c)) = Maybe (QExprToIdentity (table c))
type QExprToField (table (Nullable (QGenExpr context syntax s))) 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (table (Nullable (QGenExpr context syntax s))) = table (Nullable (QField s))
type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt 
Instance details

Defined in Database.Beam.Query.Internal

type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt = tbl (Nullable (QGenExpr ctxt syntax s))

(<-.) :: SqlUpdatable be s lhs rhs => lhs -> rhs -> QAssignment be s infix 4 #

Update a QField or Beamable type containing QFields with the given QGenExpr or Beamable type containing QGenExpr

data TxOpt Source #

Transaction option: provide WithTx to wrap operations in BEGIN/COMMIT, or NoTx to skip that.

Constructors

NoTx 
WithTx 
Instances
Bounded TxOpt Source # 
Instance details

Defined in TsWeb.Db

Enum TxOpt Source # 
Instance details

Defined in TsWeb.Db

Eq TxOpt Source # 
Instance details

Defined in TsWeb.Db

Methods

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

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

Ord TxOpt Source # 
Instance details

Defined in TsWeb.Db

Methods

compare :: TxOpt -> TxOpt -> Ordering #

(<) :: TxOpt -> TxOpt -> Bool #

(<=) :: TxOpt -> TxOpt -> Bool #

(>) :: TxOpt -> TxOpt -> Bool #

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

max :: TxOpt -> TxOpt -> TxOpt #

min :: TxOpt -> TxOpt -> TxOpt #

Show TxOpt Source # 
Instance details

Defined in TsWeb.Db

Methods

showsPrec :: Int -> TxOpt -> ShowS #

show :: TxOpt -> String #

showList :: [TxOpt] -> ShowS #

data QueryResult a Source #

Result of a select operation. This will either succeed with a QSimply, or fail with a QError (probably then an error in the db connection or table definitions).

Constructors

QSimply a 
QError SqlError 
Instances
Eq a => Eq (QueryResult a) Source # 
Instance details

Defined in TsWeb.Db

Show a => Show (QueryResult a) Source # 
Instance details

Defined in TsWeb.Db

data ExecResult a Source #

The result of a select, insert, update, or delete operation. This adds a constraint error to the QueryResult, making it nicer to filter out conflicts when handling errors.

Instances
Eq a => Eq (ExecResult a) Source # 
Instance details

Defined in TsWeb.Db

Methods

(==) :: ExecResult a -> ExecResult a -> Bool #

(/=) :: ExecResult a -> ExecResult a -> Bool #

Show a => Show (ExecResult a) Source # 
Instance details

Defined in TsWeb.Db

runSelectReturningList :: (ReadOnlyM m, FromBackendRow Postgres a) => Sel a -> m [a] Source #

runSelectReturningOne :: (ReadOnlyM m, FromBackendRow Postgres a) => Sel a -> m (Maybe a) Source #

query :: ListContains n ReadOnlyPool xs => TxOpt -> RoPg a -> TsActionCtxT lts xs sessdata (QueryResult a) Source #

Run one or many Beam runSelectReturningList or runSelectReturningOne operation(s) against a view's ReadOnlyPool.

queryMaybe :: (ListContains n ReadOnlyPool xs, FromBackendRow Postgres a) => Sel a -> TsActionCtxT lts xs sessdata (QueryResult (Maybe a)) Source #

Run a single Beam select, returning a single (Maybe) value

queryList :: (ListContains n ReadOnlyPool xs, FromBackendRow Postgres a) => Sel a -> TsActionCtxT lts xs sessdata (QueryResult [a]) Source #

Run a single Beam select, returning a list of values

execute :: ListContains n ReadWritePool xs => TxOpt -> Pg a -> TsActionCtxT lts xs sessdata (ExecResult a) Source #

Run any arbitrary Pg monad in the context of a view, returning an ExecResult