squeal-postgresql-0.9.0.0: Squeal PostgreSQL Library
Copyright(c) Eitan Chatav 2019
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.Session.Exception

Description

exceptions

Synopsis

Documentation

data SquealException Source #

Exceptions that can be thrown by Squeal.

Constructors

SQLException SQLState

SQL exception state

ConnectionException Text

LibPQ function connection exception

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

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 #

Constructors

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.

catchSqueal Source #

Arguments

:: MonadCatch m 
=> m a 
-> (SquealException -> m a)

handler

-> m a 

handleSqueal Source #

Arguments

:: MonadCatch m 
=> (SquealException -> m a)

handler

-> m a 
-> m a 

trySqueal :: MonadCatch m => m a -> m (Either SquealException a) Source #

Either return a SquealException or a result.