Copyright | (c) 2016 Al Zohali |
---|---|
License | BSD3 |
Maintainer | Al Zohali <zohl@fmap.me> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Description
postgresql-simple-bind is an extension for postgresql-simple library that faciliates and automates bindings creation. This is especially useful in a design pattern where an application communicates with a database via API hiding the internal structure of the latter.
- bindFunction :: PostgresBindOptions -> Text -> Q [Dec]
- data PostgresBindOptions = PostgresBindOptions {
- pboFunctionName :: PGFunction -> String
- pboIsNullable :: String -> String -> Bool
- pboSetOfReturnType :: String -> ReturnType
- data ReturnType
- data PostgresBindException
- type family PostgresType (a :: Symbol)
- data PGFunction = PGFunction String String [PGArgument] PGResult
- data PGArgument = PGArgument String String Bool
- data PGColumn = PGColumn String String
- data PGResult
Documentation
bindFunction :: PostgresBindOptions -> Text -> Q [Dec] Source #
Function that constructs binding for PostgreSQL stored function by it's signature.
data PostgresBindOptions Source #
Options that specify how to construct the function binding.
PostgresBindOptions | |
|
data PostgresBindException Source #
The exception is thrown when something goes wrong with this package.
ParserFailed String | Thrown when parser fails to process a function declaration. Arguments of the constructor: error message from the parser. |
DefaultValueNotFound String | Thrown when |
type family PostgresType (a :: Symbol) Source #
Mapping from PostgreSQL types to Haskell types.
type PostgresType "bigint" Source # | |
type PostgresType "character varying" Source # | |
type PostgresType "timestamp with time zone" Source # | |
type PostgresType "timestamptz" Source # | |
type PostgresType "varchar" Source # | |
type PostgresType "void" Source # | |
data PGFunction Source #
Representation of a PostrgeSQL function signature (schema, name, arguments, result).
data PGArgument Source #
Representation of a function's argument (name, type, is optional).
Representation of a resultant's column (name, type).