Skip to content

Commit

Permalink
fix: translate SQLITE_CONSTRAINT_PRIMARYKEY to ErrDuplicatedKey (#152)
Browse files Browse the repository at this point in the history
Translate the SQLITE_CONSTRAINT_PRIMARYKEY error code to
ErrDuplicatedKey as well for consistency.
  • Loading branch information
bfabio committed Jun 9, 2023
1 parent 9ac07d2 commit 2a60d4f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions error_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

var errCodes = map[int]error{
1555: gorm.ErrDuplicatedKey,
2067: gorm.ErrDuplicatedKey,
768: gorm.ErrForeignKeyViolated,
}
Expand Down

0 comments on commit 2a60d4f

Please sign in to comment.