úÎ~Zz·>      !"#$%&'()*+,-./0123456789:;<=/Newtype wrapper for marking an default argumentPortableSafe5TWrapper around >4 to distinguish default arguments from nullable onesNone5IT      *Query context that is used as temp storage Not portableNone !"*5ADRT)Catches intermediate parameters for query&List of named and positional arguments Schema nameWhether the query returns voidGEncapsulated argument that can be serialized into field or type checkedThe type parameter can be ? for query generation or Typeable$ for type checking of DB signature.3Captures special cases of stored function arguments*Variadic argument has uncommon call syntaxDefault keyword Common case@*Check whether an argument is not specifiedNew empty query context!Add new argument to query contextA.Helper to split positional and named argumentsQPG call conventions require that named arguments cannot precede positional ones. -Construct query that calls DB stored function@Name of argument, B for positional argumentsValue of argumentContextNew context with the argumentA Name of functionContext  @A Deriving DB client from API Not portableNone59;<=ADQRT$Derive DB client from API%"Associated type of deriving result& Derive DB client from API layout'Derive DB client from API(0Deriving call to DB procedure with single result ÿ type API = Arg "a" Int -> Procedure "squareReturning" (Int, Int) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m square :: Int -> MyMonad (Int, Int) square = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) \Upper example will derive the following SQL call: >>> SELECT * FROM squareReturning() AS t;MThe instance expects that return type of SQL stored function is a single row.)2Deriving call to DB procedure with optional result ÿCdata User -- user data instance FromRow User type API = ArgPos Int :> Procedure "user" (Maybe User) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m getUsers :: MyMonad (Maybe User) getUsers = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) RUpper example will derive the following SQL call: >>> SELECT * FROM user(?) AS t;+2Deriving call to DB procedure with multiple result ÿ*data User -- user data instance FromRow User type API = Procedure "users" [User] data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m getUsers :: MyMonad [User] getUsers = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) RUpper example will derive the following SQL call: >>> SELECT * FROM users() AS t;And the instance expects that users& function return type is `SETOF user`.,1Deriving call to DB procedure with no return type ÿBdata User -- user data instance ToRow User type API = Arg "user" User :> Procedure "registerUser" () data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m getUsers :: User -> MyMonad () getUsers = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) XUpper example will derive the following SQL call: >>> SELECT registerUser("user" => ?);And the instance expects that users& function return type is `SETOF user`.-?Deriving call to DB procedure with positional default arguments ÿ#type API = ArgPos (Default Int) :> Procedure "foo" (Only Int) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m dbFoo :: Default Int -> MyMonad (Only Int) dbFoo = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) WUpper example will derive the following SQL call: >>> SELECT * FROM foo(DEFAULT) AS t;.@Deriving call to DB procedure with positional variadic arguments ÿ.type API = ArgPos (Variadic Int) :> Procedure "mleast" (Only Int) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m dbMleast :: Variadic Int -> MyMonad (Only Int) dbMleast = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) ]Upper example will derive the following SQL call: >>> SELECT * FROM mleast(VARIADIC ?) AS t;/7Deriving call to DB procedure with positional arguments ÿ type API = Arg Int :> Arg Int :> Procedure "sum" (Only Int) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m dbSum :: Int -> Int -> MyMonad (Only Int) dbSum = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) TUpper example will derive the following SQL call: >>> SELECT * FROM sum(?, ?) AS t;0:Deriving call to DB procedure with named default arguments ÿ1type API = ArgNamed "a" (Defaultable Int) :> Procedure "foo" (Only Int) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m dbFoo :: Defaultable Int -> MyMonad (Only Int) dbFoo = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) [Upper example will derive the following SQL call: >>> SELECT * FROM default(DEFAULT) AS t;1;Deriving call to DB procedure with named variadic arguments ÿ6type API = ArgNamed "arr" (Variadic Int) :> Procedure "mleast" (Only Int) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m dbMleast :: Variadic Int -> MyMonad (Only Int) dbMleast = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) fUpper example will derive the following SQL call: >>> SELECT * FROM mleast(VARIADIC "arr" => ?) AS t;22Deriving call to DB procedure with named arguments ÿ2type API = ArgNamed "a" Int :> ArgNamed "b" Int :> Procedure "sum" (Only Int) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m dbSum :: Int -> Int -> MyMonad (Only Int) dbSum = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) bUpper example will derive the following SQL call: >>> SELECT * FROM sum("a" => ?, "b" => ?) AS t;3+Deriving several procedures to query DB API ÿtype API = "public" :> Procedure "time" (Only Integer) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m time :: MyMonad (Only Integer) time = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) The time; function will call DB with the: >>> SELECT public.time();}Note that there could be only one schema marker. If there are more than one the later (righter) will override previous ones.4+Deriving several procedures to query DB API 'type API = Procedure "time" Integer : |ÿ9 ArgNamed "a" Int :> Procedure "square" (Only Int) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m time :: MyMonad (Only Integer) square :: Int -> MyMonad (Only Int) (time, square) = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) |Upper example will derive separate endpoints with the following SQL calls: >>> SELECT time(); >>> SELECT square("a" => ?);$%&' API layoutPostgreSQL monad we operate inDerived functionsC()*+,-./01234DEF$%&''$%&$%&'C()*+,-./01234Composite types support. Not portableNone5T5Wrapper around a= that indicates that the type can be used as composite type.Dtype UserAPI = Arg "u" (Composite User) :> Procedure "insertUser" ()56785675675678<Reexport tools for deriving of PostgreSQL client for DB API. Not portableNone5T DEF $%&'567G      !"#$%&'()*+,-./01234567899:;<=>?@ABCDEFGABHIJJKL4servant-db-postgresql-0.2.0.0-CyMpYpgbcC4LSu7BTP5WuHServant.DB.PostgreSQL.DefaultServant.DB.PostgreSQL.VariadicServant.DB.PostgreSQL.ContextServant.DB.PostgreSQL.HasDBServant.DB.PostgreSQL.CompositeServant.DB.PostgreSQLDefault unDefault $fEqDefault $fOrdDefault $fShowDefault $fReadDefault$fGenericDefault0postgresql-simple-0.5.2.1-4JfGLb4EasO9xPwwaXGjOO Database.PostgreSQL.Simple.Types fromPGArrayPGArrayVariadic unVariadic$fFunctorVariadic $fEqVariadic $fOrdVariadic$fReadVariadic$fShowVariadic QueryContextqueryArguments querySchema queryVoidQueryArgArgument ArgVariadic ArgDefault ArgSimplenewQueryContextaddQueryArgumentqueryStoredFunction$fGenericArgument $fEqArgument$fShowArgumentHasDBDBderiveDBWithCtxderiveDB$fHasDBProcedurem$fHasDBProcedurem0$fFromRowMaybe$fHasDBProcedurem1$fHasDBProcedurem2 $fHasDB:>m $fHasDB:>m0 $fHasDB:>m1 $fHasDB:>m2 $fHasDB:>m3 $fHasDB:>m4 $fHasDB:>m5 $fHasDB:<|>m Composite unComposite$fToFieldComposite $fEqComposite$fGenericComposite$fShowComposite$fReadComposite$fOrdCompositebaseGHC.BaseMaybe"Database.PostgreSQL.Simple.ToFieldToField isDefaultArgquerySplitArgumentsNothingnullRowOnlyfromOnly