servant-db-postgresql-0.2.2.0: Derive a postgres client to database API specified by servant-db

PortabilityNot portable
Safe HaskellNone
LanguageHaskell2010

Servant.DB.PostgreSQL.Context

Description

 

Synopsis

Documentation

data Argument a Source #

Captures special cases of stored function arguments

Constructors

ArgVariadic (Variadic a)

Variadic argument has uncommon call syntax

ArgDefault (Maybe a)

Default keyword

ArgSimple a

Common case

Instances

Eq a => Eq (Argument a) Source # 

Methods

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

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

Show a => Show (Argument a) Source # 

Methods

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

show :: Argument a -> String #

showList :: [Argument a] -> ShowS #

Generic (Argument a) Source # 

Associated Types

type Rep (Argument a) :: * -> * #

Methods

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

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

type Rep (Argument a) Source # 
type Rep (Argument a) = D1 (MetaData "Argument" "Servant.DB.PostgreSQL.Context" "servant-db-postgresql-0.2.2.0-CTbjaIKTSkuAtbfEolbg6O" False) ((:+:) (C1 (MetaCons "ArgVariadic" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Variadic a)))) ((:+:) (C1 (MetaCons "ArgDefault" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe a)))) (C1 (MetaCons "ArgSimple" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))))

data QueryArg r Source #

Encapsulated argument that can be serialized into field or type checked

The type parameter can be ToField for query generation or Typeable for type checking of DB signature.

Constructors

r a => QueryArg (Argument a) 

data QueryContext r Source #

Catches intermediate parameters for query

Constructors

QueryContext 

Fields

newQueryContext :: QueryContext r Source #

New empty query context

addQueryArgument Source #

Arguments

:: r a 
=> Maybe Text

Name of argument, Nothing for positional arguments

-> Argument a

Value of argument

-> QueryContext r

Context

-> QueryContext r

New context with the argument

Add new argument to query context

queryStoredFunction Source #

Arguments

:: r ~ ToField 
=> Text

Name of function

-> QueryContext r

Context

-> SqlBuilder 

Construct query that calls DB stored function