Safe Haskell | None |
---|---|
Language | Haskell98 |
Re-exports MetaHDBC modules and a little part HDBC.ODBC.
- module Database.MetaHDBC.SimpleSqlParser
- module Database.MetaHDBC.SqlExpr
- module Database.MetaHDBC.SqlTypeIdExpQ
- cachingConnection :: String -> IO CachingConnection
- disconnect :: IConnection conn => conn -> IO ()
- commit :: IConnection conn => conn -> IO ()
- rollback :: IConnection conn => conn -> IO ()
- connectODBC :: String -> IO Connection
- data Connection :: *
Documentation
module Database.MetaHDBC.SqlExpr
disconnect :: IConnection conn => conn -> IO ()
Disconnect from the remote database.
You do not need to explicitly close an IConnection object, but you may do so if
you so desire. If you don't, the object will disconnect from the database
in a sane way when it is garbage-collected. However, a disconnection may
raise an error, so you are encouraged to explicitly call disconnect
. Also,
garbage collection may not run when the program terminates, and some databases
really like an explicit disconnect.
So, bottom line is, you're best off calling disconnect
directly, but the
world won't end if you forget.
This function discards any data not committed already. Database driver
implementators should explicitly call rollback
if their databases don't
do this automatically on disconnect.
Bad Things (TM) could happen if you call this while you have Statement
s
active. In more precise language, the results in such situations are undefined
and vary by database. So don't do it.
commit :: IConnection conn => conn -> IO ()
Commit any pending data to the database.
Required to make any changes take effect.
rollback :: IConnection conn => conn -> IO ()
connectODBC :: String -> IO Connection
data Connection :: *