mirror of
https://github.com/glebarez/sqlite.git
synced 2025-09-27 03:55:53 +08:00
fix: translate SQLITE_CONSTRAINT_PRIMARYKEY to ErrDuplicatedKey (#152)
Translate the SQLITE_CONSTRAINT_PRIMARYKEY error code to ErrDuplicatedKey as well for consistency.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
var errCodes = map[int]error{
|
||||
1555: gorm.ErrDuplicatedKey,
|
||||
2067: gorm.ErrDuplicatedKey,
|
||||
768: gorm.ErrForeignKeyViolated,
|
||||
}
|
||||
|
Reference in New Issue
Block a user