go-gorm / sqlite

GORM sqlite driver
MIT License
179 stars 184 forks source link

feat: foreign key violation error #150

Closed saeidee closed 1 year ago

saeidee commented 1 year ago

What did this pull request do?

For better development the developer-friendly error ForeignKeyViolated has been implemented on the driver so it will translate all ForeignKeyViolatation errors to native gorm error ForeignKeyViolated.

Task 3 of the incomplete feature: https://github.com/go-gorm/gorm/issues/6345

ncruces commented 1 year ago

Are we sure about 768?

The SQLite constant is 787: https://www.sqlite.org/rescode.html#constraint_foreignkey

saeidee commented 1 year ago

Are we sure about 768?

The SQLite constant is 787: https://www.sqlite.org/rescode.html#constraint_foreignkey

Yes looks like it is mistakenly added 768, thanks for pointing it out.

saeidee commented 1 year ago

Fix PR has been created. https://github.com/go-gorm/sqlite/pull/155