-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A FFI-like bindings for PostgreSQL stored functions -- -- For tutorial see here: -- https://github.com/zohl/postgresql-simple-bind/blob/master/README.md @package postgresql-simple-bind @version 0.2.0.0 -- | An algebraic data type that (partially) represents function -- declaration based on PostgreSQL documentation. module Database.PostgreSQL.Simple.Bind.Representation -- | Representation of a PostrgeSQL function signature (schema, name, -- arguments, result). data PGFunction PGFunction :: String -> String -> [PGArgument] -> PGResult -> PGFunction -- | Representation of a function's argument (name, type, is optional). data PGArgument PGArgument :: String -> String -> Bool -> PGArgument -- | Representation of a resultant's column (name, type). data PGColumn PGColumn :: String -> String -> PGColumn -- | Representation of a function's return value. data PGResult PGSingle :: String -> PGResult PGSetOf :: String -> PGResult PGTable :: [PGColumn] -> PGResult -- | The exception is thrown when something goes wrong with this package. data PostgresBindException -- | Thrown when parser fails to process a function declaration. Arguments -- of the constructor: error message from the parser. ParserFailed :: String -> PostgresBindException -- | Thrown when Argument expected to have default value while it -- doesn't. Actually this should never happen, but we all know... DefaultValueNotFound :: String -> PostgresBindException -- | Takes PostgreSQL function signature and represent it as an algebraic -- data type. parsePGFunction :: (MonadThrow m) => Text -> m PGFunction instance GHC.Classes.Eq Database.PostgreSQL.Simple.Bind.Representation.PGFunction instance GHC.Show.Show Database.PostgreSQL.Simple.Bind.Representation.PGFunction instance GHC.Classes.Eq Database.PostgreSQL.Simple.Bind.Representation.PGResult instance GHC.Show.Show Database.PostgreSQL.Simple.Bind.Representation.PGResult instance GHC.Classes.Eq Database.PostgreSQL.Simple.Bind.Representation.PGColumn instance GHC.Show.Show Database.PostgreSQL.Simple.Bind.Representation.PGColumn instance GHC.Classes.Eq Database.PostgreSQL.Simple.Bind.Representation.PGArgument instance GHC.Show.Show Database.PostgreSQL.Simple.Bind.Representation.PGArgument instance GHC.Show.Show Database.PostgreSQL.Simple.Bind.Representation.PostgresBindException instance GHC.Classes.Eq Database.PostgreSQL.Simple.Bind.Representation.PostgresBindException instance GHC.Exception.Exception Database.PostgreSQL.Simple.Bind.Representation.PostgresBindException -- | Common functions and types. module Database.PostgreSQL.Simple.Bind.Common -- | Remove list and Only constructors. unwrapRow :: [Only a] -> a -- | Remove Only constructor. unwrapColumn :: [Only a] -> [a] -- | Options that specify how to construct the function binding. data PostgresBindOptions PostgresBindOptions :: (PGFunction -> String) -> PostgresBindOptions -- | Function that generates name of a binding [pboFunctionName] :: PostgresBindOptions -> PGFunction -> String instance Data.Default.Class.Default Database.PostgreSQL.Simple.Bind.Common.PostgresBindOptions -- | Default instances for PostgresType family. module Database.PostgreSQL.Simple.Bind.Types -- | Mapping from PostgreSQL types to Haskell types. -- | Misc auxiliary functions. module Database.PostgreSQL.Simple.Bind.Utils -- | Fetch function declaration(s) from database. getFunctionDeclaration :: Connection -> String -> IO [String] -- | Generate module with bindings. generateBindingsModule :: Connection -> String -> String -> [String] -> IO String -- |

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. module Database.PostgreSQL.Simple.Bind -- | Function that constructs binding for PostgreSQL stored function by -- it's signature. bindFunction :: PostgresBindOptions -> Text -> Q [Dec] -- | Options that specify how to construct the function binding. data PostgresBindOptions PostgresBindOptions :: (PGFunction -> String) -> PostgresBindOptions -- | Function that generates name of a binding [pboFunctionName] :: PostgresBindOptions -> PGFunction -> String -- | The exception is thrown when something goes wrong with this package. data PostgresBindException -- | Thrown when parser fails to process a function declaration. Arguments -- of the constructor: error message from the parser. ParserFailed :: String -> PostgresBindException -- | Thrown when Argument expected to have default value while it -- doesn't. Actually this should never happen, but we all know... DefaultValueNotFound :: String -> PostgresBindException -- | Mapping from PostgreSQL types to Haskell types. -- | Representation of a PostrgeSQL function signature (schema, name, -- arguments, result). data PGFunction PGFunction :: String -> String -> [PGArgument] -> PGResult -> PGFunction -- | Representation of a function's argument (name, type, is optional). data PGArgument PGArgument :: String -> String -> Bool -> PGArgument -- | Representation of a resultant's column (name, type). data PGColumn PGColumn :: String -> String -> PGColumn -- | Representation of a function's return value. data PGResult PGSingle :: String -> PGResult PGSetOf :: String -> PGResult PGTable :: [PGColumn] -> PGResult