Skip to content

Add ability to control transactions

Compare
Choose a tag to compare
@VaporBot VaporBot released this 30 Jun 15:02
· 21 commits to main since this release
a8b2839
This patch was authored and released by @0xTim.

Adds the ability to control starting, committing and rolling back transactions outside of the main Fluent API. This could be used for setting up tests.

Since the new APIs give you manual control over a transaction, you should not use Database.transaction(_:) when using the manual transaction control. The inTransactionFlag will not be set when manually controlling a transaction

Warning: It is the users' responsibility to ensure the handle errors and rollback when necessary and commit transactions

Related to vapor/fluent-kit#520