This commit is contained in:
jdl
2024-11-18 17:01:17 +01:00
parent 687206bb45
commit 3b23aeabbe
2 changed files with 50 additions and 26 deletions

View File

@@ -2,7 +2,7 @@ package sqliteutil
import "github.com/mattn/go-sqlite3"
func ErrIsDuplicate(err error) bool {
func ErrIsConstraint(err error) bool {
e, ok := err.(sqlite3.Error)
return ok && e.Code == 19
}