gator/internal/executors/utils.go
Dan Anglin 7783c10504
refactor: project restructuring
- Moved the state implementation to internal/state.
- Moved the executors to internal/executors.
2024-10-01 05:44:21 +01:00

19 lines
245 B
Go

package executors
import (
"errors"
"github.com/lib/pq"
)
func uniqueViolation(err error) bool {
var pqError *pq.Error
if errors.As(err, &pqError) {
if pqError.Code.Name() == "unique_violation" {
return true
}
}
return false
}