transaction method

void transaction(
  1. void callback()
)

Implementation

void transaction(void Function() callback) {
  execute("BEGIN");
  try {
    callback();
    execute("COMMIT");
  } catch (e) {
    execute("ROLLBACK");
    rethrow;
  }
}