haskelldb-0.9: ContentsIndex
Database.HaskellDB.GenericConnect
Portabilityportable
Stabilityexperimental
Maintainerdp03-7@mdstud.chalmers.se
Description
Loads the correct interface files during compile time, allowing us to do fake generic connects
Synopsis
genericConnect :: String -> [String] -> (Database -> IO a) -> IO a
Documentation
genericConnect
:: StringThe type of the database, which can be one of odbc, mysql, sqlite or postgresql.
-> [String]An ordered list of arguments needed to connect to the database.
-> (Database -> IO a)Function/query to be performed on the database.
-> IO aResult of the function/query.

The function genericConnect connects to a database and performs a given function on the database and return the result of the funtion. The funtion takes as argument the type of the database, an ordered list of arguments depends on which depends on the type of the database.

odbc
dsn, userid and password.
mysql
server, database, userid and password.
sqlite
filepath and IOMode.
postgresql
server, database, userid and password.
Produced by Haddock version 0.8