Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Session a
- data SessionError
- data QueryError = QueryError ByteString [Text] CommandError
- data CommandError
- runSessionOnLocalDb :: Session a -> IO (Either SessionError a)
- runStatementInSession :: Statement a b -> a -> Session b
Documentation
A batch of actions to be executed in the context of a database connection.
Instances
MonadIO Session | |
Defined in Hasql.Session.Core | |
Applicative Session | |
Functor Session | |
Monad Session | |
MonadError QueryError Session | |
Defined in Hasql.Session.Core throwError :: QueryError -> Session a # catchError :: Session a -> (QueryError -> Session a) -> Session a # | |
MonadReader Connection Session | |
Defined in Hasql.Session.Core ask :: Session Connection # local :: (Connection -> Connection) -> Session a -> Session a # reader :: (Connection -> a) -> Session a # |
data SessionError Source #
Instances
Show SessionError Source # | |
Defined in Hasql.TestingUtils.TestingDsl showsPrec :: Int -> SessionError -> ShowS # show :: SessionError -> String # showList :: [SessionError] -> ShowS # | |
Eq SessionError Source # | |
Defined in Hasql.TestingUtils.TestingDsl (==) :: SessionError -> SessionError -> Bool # (/=) :: SessionError -> SessionError -> Bool # |
data QueryError #
An error during the execution of a query. Comes packed with the query template and a textual representation of the provided params.
Instances
Exception QueryError | |
Defined in Hasql.Errors toException :: QueryError -> SomeException # fromException :: SomeException -> Maybe QueryError # displayException :: QueryError -> String # | |
Show QueryError | |
Defined in Hasql.Errors showsPrec :: Int -> QueryError -> ShowS # show :: QueryError -> String # showList :: [QueryError] -> ShowS # | |
Eq QueryError | |
Defined in Hasql.Errors (==) :: QueryError -> QueryError -> Bool # (/=) :: QueryError -> QueryError -> Bool # | |
MonadError QueryError Session | |
Defined in Hasql.Session.Core throwError :: QueryError -> Session a # catchError :: Session a -> (QueryError -> Session a) -> Session a # |
data CommandError #
An error of some command in the session.
ClientError (Maybe ByteString) | An error on the client-side, with a message generated by the "libpq" library. Usually indicates problems with connection. |
ResultError ResultError | Some error with a command result. |
Instances
Show CommandError | |
Defined in Hasql.Errors showsPrec :: Int -> CommandError -> ShowS # show :: CommandError -> String # showList :: [CommandError] -> ShowS # | |
Eq CommandError | |
Defined in Hasql.Errors (==) :: CommandError -> CommandError -> Bool # (/=) :: CommandError -> CommandError -> Bool # |
runSessionOnLocalDb :: Session a -> IO (Either SessionError a) Source #
runStatementInSession :: Statement a b -> a -> Session b Source #