dex/db/conn_postgres.go
2016-03-02 12:02:55 -08:00

16 lines
261 B
Go

package db
// Register the postgres driver.
import "github.com/lib/pq"
func init() {
registerAlreadyExistsChecker(func(err error) bool {
sqlErr, ok := err.(*pq.Error)
if !ok {
return false
}
return sqlErr.Code == pgErrorCodeUniqueViolation
})
}