Translate the SQLITE_CONSTRAINT_PRIMARYKEY error code to ErrDuplicatedKey as well for consistency.
User Case Description
We refactored our code to take advantage of ErrDuplicatedKey, but the tests fail because ErrDuplicatedKey only gets returned for non primary key fields (and it should IMO):
What did this pull request do?
Translate the SQLITE_CONSTRAINT_PRIMARYKEY error code to ErrDuplicatedKey as well for consistency.
User Case Description
We refactored our code to take advantage of ErrDuplicatedKey, but the tests fail because ErrDuplicatedKey only gets returned for non primary key fields (and it should IMO):
https://github.com/italia/developers-italia-api/pull/197 https://github.com/italia/developers-italia-api/actions/runs/5143820348/jobs/9259314436?pr=197
Also, should this go in https://github.com/go-gorm/postgres and https://github.com/go-gorm/mysql as well?