MCPcopy Create free account
hub / github.com/fnproject/fn / IsDuplicateKeyError

Method IsDuplicateKeyError

api/datastore/sql/postgres/postgres.go:50–58  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

48}
49
50func (postgresHelper) IsDuplicateKeyError(err error) bool {
51 switch dbErr := err.(type) {
52 case *pq.Error:
53 if dbErr.Code == "23505" {
54 return true
55 }
56 }
57 return false
58}
59
60func init() {
61 dbhelper.Register(postgresHelper(0))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected