Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data Conn = forall conn.IConnection conn => Conn {
- db :: Database
- implicitCommit :: Bool
- connection :: conn
- connect :: forall conn. IConnection conn => Database -> conn -> Conn
- data Database
Documentation
This module defines a wrapper around an HDBC IConnection. Using this wrapper Conn
simplifies the signature of the functions in the GP
module.
It allows to use any HDBC connection without having to define a new function for each connection type.
It also provides additional attributes to the connection, like the database type and the implicit commit flag.
These attributes can be used to implement database specific functionality, modify transaction behaviour, etc.
This code has been inspired by the HDBC ConnectionWrapper and some parts have been copied from the HDBC Database.HDBC.Types module.
A wrapper around an HDBC IConnection.
forall conn.IConnection conn => Conn | |
|
Instances
IConnection Conn Source # | manually implement the IConnection type class for the Conn type. |
Defined in Database.GP.Conn disconnect :: Conn -> IO () # runRaw :: Conn -> String -> IO () # run :: Conn -> String -> [SqlValue] -> IO Integer # prepare :: Conn -> String -> IO Statement # hdbcDriverName :: Conn -> String # hdbcClientVer :: Conn -> String # proxiedClientName :: Conn -> String # proxiedClientVer :: Conn -> String # dbServerVer :: Conn -> String # dbTransactionSupport :: Conn -> Bool # getTables :: Conn -> IO [String] # describeTable :: Conn -> String -> IO [(String, SqlColDesc)] # |
connect :: forall conn. IConnection conn => Database -> conn -> Conn Source #
a smart constructor for the Conn type.
An enumeration of the supported database types.
Instances
Enum Database Source # | |
Show Database Source # | |
Eq Database Source # | |