Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Postgres SQL Error
Functions and datatypes for interpreting Postgres errors.
Synopsis
- data PGErrorType
- = PGDataException (Maybe (PGErrorCode PGDataException))
- | PGIntegrityConstraintViolation (Maybe (PGErrorCode PGIntegrityConstraintViolation))
- | PGSyntaxErrorOrAccessRuleViolation (Maybe (PGErrorCode PGSyntaxErrorOrAccessRuleViolation))
- | PGTransactionRollback (Maybe (PGErrorCode PGTransactionRollback))
- data PGErrorCode a
- data PGDataException
- data PGIntegrityConstraintViolation
- data PGSyntaxErrorOrAccessRuleViolation
- data PGTransactionRollback = PGSerializationFailure
- _PGTransactionRollback :: Prism' PGErrorType (Maybe (PGErrorCode PGTransactionRollback))
- _PGSyntaxErrorOrAccessRuleViolation :: Prism' PGErrorType (Maybe (PGErrorCode PGSyntaxErrorOrAccessRuleViolation))
- _PGIntegrityConstraintViolation :: Prism' PGErrorType (Maybe (PGErrorCode PGIntegrityConstraintViolation))
- _PGDataException :: Prism' PGErrorType (Maybe (PGErrorCode PGDataException))
- _PGErrorSpecific :: forall a a. Prism (PGErrorCode a) (PGErrorCode a) a a
- _PGErrorGeneric :: forall a. Prism' (PGErrorCode a) ()
- pgErrorType :: PGStmtErrDetail -> Maybe PGErrorType
Documentation
data PGErrorType Source #
The top-level error code type. Errors in Postgres are divided into different classes, which are further subdivided into individual error codes. Even if a particular status code is not known to the application, it’s possible to determine its class and handle it appropriately.
Instances
Show PGErrorType Source # | |
Defined in Hasura.Backends.Postgres.SQL.Error showsPrec :: Int -> PGErrorType -> ShowS # show :: PGErrorType -> String # showList :: [PGErrorType] -> ShowS # | |
Eq PGErrorType Source # | |
Defined in Hasura.Backends.Postgres.SQL.Error (==) :: PGErrorType -> PGErrorType -> Bool # (/=) :: PGErrorType -> PGErrorType -> Bool # |
data PGErrorCode a Source #
PGErrorGeneric | represents errors that have the non-specific |
PGErrorSpecific a | represents errors with a known, more specific status code |
Instances
Functor PGErrorCode Source # | |
Defined in Hasura.Backends.Postgres.SQL.Error fmap :: (a -> b) -> PGErrorCode a -> PGErrorCode b # (<$) :: a -> PGErrorCode b -> PGErrorCode a # | |
Show a => Show (PGErrorCode a) Source # | |
Defined in Hasura.Backends.Postgres.SQL.Error showsPrec :: Int -> PGErrorCode a -> ShowS # show :: PGErrorCode a -> String # showList :: [PGErrorCode a] -> ShowS # | |
Eq a => Eq (PGErrorCode a) Source # | |
Defined in Hasura.Backends.Postgres.SQL.Error (==) :: PGErrorCode a -> PGErrorCode a -> Bool # (/=) :: PGErrorCode a -> PGErrorCode a -> Bool # |
data PGDataException Source #
Instances
Show PGDataException Source # | |
Defined in Hasura.Backends.Postgres.SQL.Error showsPrec :: Int -> PGDataException -> ShowS # show :: PGDataException -> String # showList :: [PGDataException] -> ShowS # | |
Eq PGDataException Source # | |
Defined in Hasura.Backends.Postgres.SQL.Error (==) :: PGDataException -> PGDataException -> Bool # (/=) :: PGDataException -> PGDataException -> Bool # |
data PGIntegrityConstraintViolation Source #
PGRestrictViolation | |
PGNotNullViolation | |
PGForeignKeyViolation | |
PGUniqueViolation | |
PGCheckViolation | |
PGExclusionViolation |
Instances
data PGTransactionRollback Source #
Instances
Show PGTransactionRollback Source # | |
Defined in Hasura.Backends.Postgres.SQL.Error showsPrec :: Int -> PGTransactionRollback -> ShowS # show :: PGTransactionRollback -> String # showList :: [PGTransactionRollback] -> ShowS # | |
Eq PGTransactionRollback Source # | |
Defined in Hasura.Backends.Postgres.SQL.Error (==) :: PGTransactionRollback -> PGTransactionRollback -> Bool # (/=) :: PGTransactionRollback -> PGTransactionRollback -> Bool # |
_PGSyntaxErrorOrAccessRuleViolation :: Prism' PGErrorType (Maybe (PGErrorCode PGSyntaxErrorOrAccessRuleViolation)) Source #
_PGIntegrityConstraintViolation :: Prism' PGErrorType (Maybe (PGErrorCode PGIntegrityConstraintViolation)) Source #
_PGErrorSpecific :: forall a a. Prism (PGErrorCode a) (PGErrorCode a) a a Source #
_PGErrorGeneric :: forall a. Prism' (PGErrorCode a) () Source #