go/sqliteutil/errors.go

9 lines
156 B
Go
Raw Normal View History

2024-11-17 14:18:05 +00:00
package sqliteutil
import "github.com/mattn/go-sqlite3"
2024-11-18 16:01:17 +00:00
func ErrIsConstraint(err error) bool {
2024-11-17 14:18:05 +00:00
e, ok := err.(sqlite3.Error)
return ok && e.Code == 19
}