Copyright | (c) Eitan Chatav 2019 |
---|---|
Maintainer | eitan@morphism.tech |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
exceptions
Synopsis
- data SquealException
- pattern UniqueViolation :: ByteString -> SquealException
- pattern CheckViolation :: ByteString -> SquealException
- pattern SerializationFailure :: ByteString -> SquealException
- pattern DeadlockDetected :: ByteString -> SquealException
- data SQLState = SQLState {}
- data ExecStatus
- catchSqueal :: MonadCatch m => m a -> (SquealException -> m a) -> m a
- handleSqueal :: MonadCatch m => (SquealException -> m a) -> m a -> m a
- trySqueal :: MonadCatch m => m a -> m (Either SquealException a)
- throwSqueal :: MonadThrow m => SquealException -> m a
Documentation
data SquealException Source #
Exception
s that can be thrown by Squeal.
SQLException SQLState | SQL exception state |
ConnectionException Text |
|
DecodingException Text Text | decoding exception function and error message |
ColumnsException Text Column | unexpected number of columns |
RowsException Text Row Row | too few rows, expected at least and actual number of rows |
Instances
Eq SquealException Source # | |
Defined in Squeal.PostgreSQL.Session.Exception (==) :: SquealException -> SquealException -> Bool # (/=) :: SquealException -> SquealException -> Bool # | |
Show SquealException Source # | |
Defined in Squeal.PostgreSQL.Session.Exception showsPrec :: Int -> SquealException -> ShowS # show :: SquealException -> String # showList :: [SquealException] -> ShowS # | |
Exception SquealException Source # | |
Defined in Squeal.PostgreSQL.Session.Exception |
pattern UniqueViolation :: ByteString -> SquealException Source #
A pattern for unique violation exceptions.
pattern CheckViolation :: ByteString -> SquealException Source #
A pattern for check constraint violation exceptions.
pattern SerializationFailure :: ByteString -> SquealException Source #
A pattern for serialization failure exceptions.
pattern DeadlockDetected :: ByteString -> SquealException Source #
A pattern for deadlock detection exceptions.
data ExecStatus #
EmptyQuery | The string sent to the server was empty. |
CommandOk | Successful completion of a command returning no data. |
TuplesOk | Successful completion of a command returning data (such as a SELECT or SHOW). |
CopyOut | Copy Out (from server) data transfer started. |
CopyIn | Copy In (to server) data transfer started. |
CopyBoth | Copy In/Out data transfer started. |
BadResponse | The server's response was not understood. |
NonfatalError | A nonfatal error (a notice or warning) occurred. |
FatalError | A fatal error occurred. |
SingleTuple | The PGresult contains a single result tuple from the current command. This status occurs only when single-row mode has been selected for the query. |
Instances
Enum ExecStatus | |
Defined in Database.PostgreSQL.LibPQ succ :: ExecStatus -> ExecStatus # pred :: ExecStatus -> ExecStatus # toEnum :: Int -> ExecStatus # fromEnum :: ExecStatus -> Int # enumFrom :: ExecStatus -> [ExecStatus] # enumFromThen :: ExecStatus -> ExecStatus -> [ExecStatus] # enumFromTo :: ExecStatus -> ExecStatus -> [ExecStatus] # enumFromThenTo :: ExecStatus -> ExecStatus -> ExecStatus -> [ExecStatus] # | |
Eq ExecStatus | |
Defined in Database.PostgreSQL.LibPQ (==) :: ExecStatus -> ExecStatus -> Bool # (/=) :: ExecStatus -> ExecStatus -> Bool # | |
Show ExecStatus | |
Defined in Database.PostgreSQL.LibPQ showsPrec :: Int -> ExecStatus -> ShowS # show :: ExecStatus -> String # showList :: [ExecStatus] -> ShowS # |
:: MonadCatch m | |
=> m a | |
-> (SquealException -> m a) | handler |
-> m a |
Catch SquealException
s.
:: MonadCatch m | |
=> (SquealException -> m a) | handler |
-> m a | |
-> m a |
Handle SquealException
s.
trySqueal :: MonadCatch m => m a -> m (Either SquealException a) Source #
Either
return a SquealException
or a result.
throwSqueal :: MonadThrow m => SquealException -> m a Source #
Throw SquealException
s.