SQLStore: Align SQLite IsUniqueConstraintViolation() with other backend implementations (#69224)

* Add integration test for primary key and unique constrain violation

* Align SQLite IsUniqueConstraintViolation implementation with other backends
This commit is contained in:
Sofia Papagiannaki
2023-05-29 17:45:08 +03:00
committed by GitHub
parent 32a67a4ad5
commit 74e87ccbbd
2 changed files with 53 additions and 1 deletions
@@ -148,7 +148,7 @@ func (db *SQLite3) ErrorMessage(err error) string {
}
func (db *SQLite3) IsUniqueConstraintViolation(err error) bool {
return db.isThisError(err, int(sqlite3.ErrConstraintUnique))
return db.isThisError(err, int(sqlite3.ErrConstraintUnique)) || db.isThisError(err, int(sqlite3.ErrConstraintPrimaryKey))
}
func (db *SQLite3) IsDeadlock(err error) bool {