This commit is contained in:
2025-04-14 15:42:22 +08:00
parent 371b89ee8d
commit 461531c308
133 changed files with 58 additions and 14400 deletions

View File

@@ -0,0 +1,15 @@
package database
import (
"errors"
"gorm.io/gorm"
)
func IsUniqueViolation(err error) bool {
return errors.Is(err, gorm.ErrDuplicatedKey)
}
func IsNoRows(err error) bool {
return errors.Is(err, gorm.ErrRecordNotFound)
}