hsql-1.8.2: Database access from Haskell.

Safe Haskell | Safe-Inferred

DB.HSQL.Core

Description

Management of handles and exception handling.

Synopsis

- closeHandle :: MVar Bool -> IO () -> IO ()
- checkHandle :: MVar Bool -> IO a -> IO a
- sqlExceptions :: Exception x => x -> Maybe SqlError
- catchSql :: IO a -> (SqlError -> IO a) -> IO a
- handleSql :: (SqlError -> IO a) -> IO a -> IO a

# Documentation

closeHandle Source

Arguments

:: MVar Bool | closing state ref
-> IO () | DB action to do if not closed
-> IO () |

if closed, no action.

checkHandle Source

Arguments

:: MVar Bool | closing state ref
-> IO a | DB action to do if not closed
-> IO a |

if closed, throws `SqlClosedHandle` exception.

sqlExceptions Source

Arguments

:: Exception x |
=> x | the exception thinc to be cast
-> Maybe SqlError |

Casts, if possible, an `Exception` to an `SqlError`.

catchSql :: IO a -> (SqlError -> IO a) -> IO aSource

Deprecated: Use Control.Exception.catch instead.

Deprecated: Use `catch` instead.

handleSql :: (SqlError -> IO a) -> IO a -> IO aSource

Deprecated: Use Control.Exception.handle instead.

Deprecated: Use `handle` instead.