Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: foreign key violation error #150

Merged
merged 2 commits into from
Jun 7, 2023

Conversation

saeidee
Copy link
Member

@saeidee saeidee commented May 30, 2023

  • Do only one thing
  • Non breaking API changes
  • Tested

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: go-gorm/gorm#6345

@saeidee saeidee changed the title feat: foreign key violatation error feat: foreign key violation error May 30, 2023
@saeidee saeidee requested a review from a631807682 May 31, 2023 07:56
@saeidee saeidee self-assigned this May 31, 2023
@jinzhu jinzhu merged commit cb7f946 into go-gorm:master Jun 7, 2023
3 checks passed
@ncruces
Copy link
Contributor

ncruces commented Jun 7, 2023

Are we sure about 768?

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

@saeidee
Copy link
Member Author

saeidee commented Jun 7, 2023

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
Copy link
Member Author

saeidee commented Jun 7, 2023

Fix PR has been created. #155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants