postgresql-simple-bind-0.4.1: FFI-like bindings for PostgreSQL stored functions

Copyright(c) 2016 Al Zohali
LicenseBSD3
MaintainerAl Zohali <zohl@fmap.me>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Simple.Bind.Representation

Description

An algebraic data type that (partially) represents function declaration based on PostgreSQL documentation.

Synopsis

Documentation

data PGFunction Source #

Representation of a PostrgeSQL function signature (schema, name, arguments, result).

data PGArgument Source #

Representation of a function's argument.

Constructors

PGArgument 

data PGColumn Source #

Representation of a resultant's column (name, type).

Constructors

PGColumn 

Fields

data PGResult Source #

Representation of a function's return value.

data PostgresBindException Source #

The exception is thrown when something goes wrong with this package.

Constructors

ParserFailed String

Thrown when parser fails to process a function declaration. Arguments of the constructor: error message from the parser.

DefaultValueNotFound String

Thrown when Argument expected to have default value while it doesn't. Actually this should never happen, but we all know...

RepresentationNotFound String

Thrown when Argument is beign printed, but representation was't provided. Again, this should never happen.

parsePGFunction :: MonadThrow m => Text -> m PGFunction Source #

Takes PostgreSQL function signature and represent it as an algebraic data type.