| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Hasql.TestingUtils.TestingDsl
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 Methods throwError :: QueryError -> Session a # catchError :: Session a -> (QueryError -> Session a) -> Session a # | |
| MonadReader Connection Session | |
Defined in Hasql.Session.Core Methods ask :: Session Connection # local :: (Connection -> Connection) -> Session a -> Session a # reader :: (Connection -> a) -> Session a # | |
data SessionError Source #
Constructors
| ConnectionError ConnectionError | |
| SessionError QueryError |
Instances
| Show SessionError Source # | |
Defined in Hasql.TestingUtils.TestingDsl Methods showsPrec :: Int -> SessionError -> ShowS # show :: SessionError -> String # showList :: [SessionError] -> ShowS # | |
| Eq SessionError Source # | |
Defined in Hasql.TestingUtils.TestingDsl | |
data QueryError #
An error during the execution of a query. Comes packed with the query template and a textual representation of the provided params.
Constructors
| QueryError ByteString [Text] CommandError |
Instances
| Exception QueryError | |
Defined in Hasql.Errors Methods toException :: QueryError -> SomeException # fromException :: SomeException -> Maybe QueryError # displayException :: QueryError -> String # | |
| Show QueryError | |
Defined in Hasql.Errors Methods showsPrec :: Int -> QueryError -> ShowS # show :: QueryError -> String # showList :: [QueryError] -> ShowS # | |
| Eq QueryError | |
Defined in Hasql.Errors | |
| MonadError QueryError Session | |
Defined in Hasql.Session.Core Methods throwError :: QueryError -> Session a # catchError :: Session a -> (QueryError -> Session a) -> Session a # | |
data CommandError #
An error of some command in the session.
Constructors
| 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 Methods showsPrec :: Int -> CommandError -> ShowS # show :: CommandError -> String # showList :: [CommandError] -> ShowS # | |
| Eq CommandError | |
Defined in Hasql.Errors | |
runSessionOnLocalDb :: Session a -> IO (Either SessionError a) Source #
runStatementInSession :: Statement a b -> a -> Session b Source #