monetdb-mapi-0.1.0.0: Mid-level bindings for the MonetDB API (mapi)

Safe HaskellSafe
LanguageHaskell2010

Database.MonetDB.Mapi

Contents

Synopsis

Error handling

data ErrorType Source #

Error types that may occur within MonetDB.

Connection parameters

data Lang Source #

The language to be used for a connection.

Constructors

Sql 
Mil 
Mal 
XQuery 

emptyConInfo :: Database -> ConInfo Source #

A ConInfo with all optional fields omitted.

defConInfo :: Database -> ConInfo Source #

A ConInfo with common default settings, mostly for testing purposes.

Connection handling

newtype Connection Source #

Constructors

Connection Mapi 

connect :: ConInfo -> Lang -> IO Connection Source #

It is strongly advised to use withConnection, which is exception-safe.

withConnection :: ConInfo -> Lang -> (Connection -> IO a) -> IO a Source #

Opens a connection, runs the action and closes the connection, even when an exception has been thrown.

>>> withConnection (defConInfo "test") Mal $ \c -> quickQuery c "io.print(42, 23);"
[["42", "23"]]

Queries

quickQuery :: Connection -> String -> IO [[String]] Source #

Run a query and fetch the result rows.