Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 811 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 811 Bytes

pgerror GoDoc Build Status Go Report Card

pgerror is a collection of helper functions to use with github.com/lib/pq Postgresql Database driver for Go Programming language.

// example use:
_, err = stmt.Exec(SomeInsertStateMent, params...)
if err != nil {
  if e := pgerror.UniqueViolation(err); e != nil {
  // you can use e here to check the fields et al
    return SomeThingAlreadyExists
  }

  return err // other cases.
}

LICENSE

MIT.