Categorygithub.com/reiver/go-pqerror
repositorypackage
0.0.0-20160209202356-63f13fe5516a
Repository: https://github.com/reiver/go-pqerror.git
Documentation: pkg.go.dev

# README

go-pqerror

A helper library that provides constants for the Postgres Error Codes, to be used with the Golang Postgres driver https://godoc.org/github.com/lib/pq

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-pqerror

GoDoc

Example

pqError := err.(*pq.Error)

switch pqError.Code {
case pqerror.CodeSyntaxError:
	//@TODO
case pqerror.CodeIntegrityConstraintViolationUniqueViolation:
	//@TODO
default:
	//@TODO
}