-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Bracketed connection for HDBC
--   
--   This package contains a base bracketed function to call close
--   correctly against opend DB connection.
@package HDBC-session
@version 0.1.2.1


-- | This module provides a base bracketed function to call close correctly
--   against opend DB connection.
module Database.HDBC.Session

-- | Run a transaction on a HDBC <a>IConnection</a> and commit at last, and
--   then close the connection. In other words, the transaction with no
--   exception is committed. Handy definition for simple transactions.
transaction :: IConnection conn => IO conn -> (conn -> IO a) -> IO a

-- | Run a transaction on a HDBC <a>IConnection</a> and close the
--   connection. Not issuing commit at last, so if you need, issue commit
--   manually in transaction body.
withConnectionIO :: IConnection conn => IO conn -> (conn -> IO a) -> IO a

-- | Same as <a>withConnectionIO</a> other than not wrapping transaction
--   body in <a>handleSqlError'</a>.
withConnectionIO_ :: IConnection conn => IO conn -> (conn -> IO a) -> IO a

-- | Generalized session with bracketed HDBC connection. Run a transaction
--   on a HDBC IConnection and close the connection.
bracketConnection :: (Monad m, IConnection conn) => (forall c. () => m c -> (c -> m ()) -> (c -> m a) -> m a) -> (forall b. () => IO b -> m b) -> IO conn -> (conn -> m a) -> m a

-- | show <a>SqlError</a> not to show <a>String</a> fields.
showSqlError :: SqlError -> String

-- | Like <tt>handleSqlError</tt>, but not to show <a>String</a> fields of
--   SqlError.
handleSqlError' :: IO a -> IO a

-- | Deprecated. use <a>bracketConnection</a> instead of this.

-- | <i>Deprecated: use <a>bracketConnection</a> instead of this.</i>
withConnection :: (Monad m, IConnection conn) => (forall c. () => m c -> (c -> m ()) -> (c -> m a) -> m a) -> (forall b. () => IO b -> m b) -> IO conn -> (conn -> m a) -> m a

-- | Deprecated. use <a>withConnectionIO</a> instead of this.

-- | <i>Deprecated: use <a>withConnectionIO</a> instead of this.</i>
withConnectionIO' :: IConnection conn => IO conn -> (conn -> IO a) -> IO a

-- | Deprecated. use <a>transaction</a> instead of this.

-- | <i>Deprecated: use <a>transaction</a> instead of this.</i>
withConnectionCommit :: IConnection conn => IO conn -> (conn -> IO a) -> IO a
