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:
Fabio Bonelli
2023-06-09 04:18:50 +02:00
committed by GitHub
parent 9ac07d2974
commit 2a60d4fe20

View File

@@ -7,6 +7,7 @@ import (
)
var errCodes = map[int]error{
1555: gorm.ErrDuplicatedKey,
2067: gorm.ErrDuplicatedKey,
768: gorm.ErrForeignKeyViolated,
}