-
-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Right now if you want to use a transaction, you have to hold onto a reference to it. In Avram, I'm working on adding the ability to run specs in a transaction that is rolled back instead of truncating the database for a major speed improvement. To do that, I monkey patched onto DB::Connection a list of transactions that functions as a stack where the first item in the list would be the parent transaction and any transactions after that would be children. I think this would be a useful thing to have in the actual library.
Reference: luckyframework/avram#780
Inspiration is from Rails: https://github.com/rails/rails/blob/619e523613e942d3fd16b43fc60be9060a29622d/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb#L226
Metadata
Metadata
Assignees
Labels
No labels