Std.Db.withSavepoint
1 declaration
fn
withSavepoint: Std.Db.Session.Connection -> Str -> fn(Std.Db.Session.Connection) -> (Result[T, Std.Db.Session.DbError], Std.Db.Session.Connection) -> (Result[T, Std.Db.Session.DbError], Std.Db.Session.Connection)This is a callable function.
What it does
Run an action between two marked points, undoing back to the first if it
failed.
The difference from a transaction is what a failure costs: this undoes only
what the action did, leaving the transaction around it intact, so one
optional step failing does not throw away the work before it.
Read the signature
- The text after the name is the type checked by Pudu.
- Read arrows from left to right: inputs come first, and the final type is returned.
- Names inside [ ] are type arguments, such as the item type held by a collection.
- Result makes success and recoverable failure part of the function's type.
