sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Implement transaction options API

Open andrewwhitehead opened this issue 3 years ago • 2 comments

This adds begin_with methods for creating transactions with additional options. The exact options object varies depending upon the backend. For MS-SQL and AnyDatabase the options are currently just () although this could be extended, with each backend transaction option struct potentially supporting From<AnyTransactionOptions>.

MySQL and Postgres both support the same ANSI isolation levels, although they are currently separate enums which could potentially be combined.

As much as possible, the tests try to verify that the correct transaction options have been applied.

Related to #481, #853, #851

andrewwhitehead avatar Apr 21 '22 22:04 andrewwhitehead

This looks really awesome! As #481 indicates, there is currently no way to do a BEGIN IMMEDIATE TRANSACTION for SQLite databases in SQLx (if I understand things correctly), and we need that functionality. I hope this can be merged soon!

xfbs avatar Jun 22 '22 15:06 xfbs

Thanks for the review @abonander, it sounds like this might need to wait for another minor release? I see there's another PR applying the feedback.

andrewwhitehead avatar Jun 22 '22 16:06 andrewwhitehead

Closing in favor of #1924

abonander avatar Sep 15 '22 01:09 abonander