MetaHDBC-0.1.4: Statically checked database access

Safe HaskellNone



Re-exports MetaHDBC modules and a little part HDBC.ODBC.



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 Statements 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 ()

Roll back to the state the database was in prior to the last commit or rollback.

data Connection :: *