pqerror

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Helpers for working with PostgreSQL errors

Index

Constants

View Source
const (
	RestrictViolation   pq.ErrorCode = "23001"
	NotNullViolation                 = "23502"
	ForeignKeyViolation              = "23503"
	UniqueViolation                  = "23505"
	CheckViolation                   = "23514"
	DeadlockDetected                 = "40P01"
	QueryCanceled                    = "57014"
)

A subset of error codes defined in https://www.postgresql.org/docs/13/errcodes-appendix.html

Variables

This section is empty.

Functions

func Is

func Is(err error, code pq.ErrorCode) bool

Returns true if and only if err is a PostgreSQL error with the given code

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL