This commit is contained in:
delete 2026-06-10 20:51:17 +03:00
commit b15b95781c
108 changed files with 14802 additions and 0 deletions

19
internal/db/errors.go Normal file
View file

@ -0,0 +1,19 @@
package db
import (
"errors"
"strings"
)
var (
ErrNotFound = errors.New("record not found")
ErrConflict = errors.New("record conflict")
)
func isUniqueConstraintError(err error) bool {
if err == nil {
return false
}
return strings.Contains(strings.ToLower(err.Error()), "unique constraint failed")
}