Skip to content

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 requested a review from a631807682 May 30, 2023 09:24
@saeidee saeidee self-assigned this May 30, 2023
@jinzhu jinzhu merged commit 18bc84b into go-gorm:master Jun 7, 2023
@Sangamesh26
Copy link

Hi @saeidee , in one of my project for foreign key violation, I am getting psql error instead of native gorm error.
Error that I got : insert or update on table "table_name" violates foreign key constraint "constraint_name" (SQLSTATE 23503)

Please could you help me understand, what may be the reasons for getting this error instead of GORM error.
Thanks

@saeidee
Copy link
Member Author

saeidee commented Mar 18, 2024

@Sangamesh26 could you please create an issue with more details potentially with a playground link?

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.

5 participants