sqlx
sqlx copied to clipboard
Allow easy retry of transation
I have found these related issues/pull requests
N/A
Description
Currently there is no special error returned that serialization error has occurred. That means that there is no easy, DB-agnostic, way of handling it separately from errors which should be returned to user like connection error.
Prefered solution
Add kind Kind::SerializationFailed. Add a has_serialization_failed to DatabaseError and Error which checks the kind.
Is this a breaking change? Why or why not?
It is not breaking change with exception that databases that would not yet implement changes would report errors as not serialization failure when they are.
You can look for 40001 serialization_failure https://www.postgresql.org/docs/current/mvcc-serialization-failure-handling.html