sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Allow easy retry of transation

Open uzytkownik opened this issue 4 months ago • 1 comments

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.

uzytkownik avatar Aug 13 '25 14:08 uzytkownik

You can look for 40001 serialization_failure https://www.postgresql.org/docs/current/mvcc-serialization-failure-handling.html

pythoneer avatar Oct 15 '25 12:10 pythoneer