The library does not return the ErrDuplicatedKey as gorm documents, but just returns the go-sqlite 2067 ("constraint failed: UNIQUE constraint failed: users.username (2067)") error.
To be compliant, there should be a mapping of the errors so that one can check errors.Is(err, gorm.ErrDuplicatedKey) independently of the used database driver.
The library does not return the ErrDuplicatedKey as gorm documents, but just returns the go-sqlite 2067 ("constraint failed: UNIQUE constraint failed: users.username (2067)") error.
To be compliant, there should be a mapping of the errors so that one can check
errors.Is(err, gorm.ErrDuplicatedKey)
independently of the used database driver.