You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test on the MSSQL database: error.nativeError.info = { number: 2627, state: 1, class: 14, message: 'Violation of PRIMARY KEY constraint '...'. Cannot insert duplicate key in object '...'. The duplicate key value is (1, 1).' }
Throw UniqueViolationError is an acceptable solution for that case.
Thanks. If other databases throw UniqueViolationError in that case, I'll make MSSQL throw one too for consistency. If none of them do, maybe a separate PrimaryKeyViolationError is better.
Possible use case:
Inserting duplicate key into a many-to-many relation table with a composite primary key.
Unique constraint not work here.
The text was updated successfully, but these errors were encountered: