hasql-0.20.1: An efficient native PostgreSQL driver

Safe HaskellNone
LanguageHaskell2010

Hasql.Connection

Documentation

data Error Source #

Constructors

BackendError !ByteString !ByteString

An erroneous result received from the DB. The components are:

  • The SQLSTATE code for the error. The SQLSTATE code identifies the type of error that has occurred; it can be used by front-end applications to perform specific operations (such as error handling) in response to a particular database error. For a list of the possible SQLSTATE codes, see Appendix A. This field is not localizable, and is always present.
  • The primary human-readable error message (typically one line). Always present.
DecodingError !Text

Can happen as a result of an incorrect decoder being applied.

TransportError !Text

Problems with the connection.

ProtocolError !Text

An unexpected or broken data packet received from the server. Can happen as a result of the server sending an unsupported message or something interfering in the communication channel. This error type is highly unlikely.

Instances

Eq Error Source # 

Methods

(==) :: Error -> Error -> Bool #

(/=) :: Error -> Error -> Bool #

Show Error Source # 

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

session :: Connection -> Session result -> IO (Either Error result) Source #

batch :: Connection -> Batch result -> IO (Either Error result) Source #