#[no_mangle]
pub extern "C" fn rorm_db_start_transaction(
    db: &'static Database,
    callback: Option<unsafe extern "C" fn(_: usize, _: Option<Box<Transaction>>, _: Error<'_>)>,
    context: usize
)
Expand description

Starts a transaction on the current database connection.

Parameter:

  • db: Reference to the Database, provided by rorm_db_connect.
  • callback: callback function. Takes the context, a pointer to a transaction and an Error.
  • context: Pass through void pointer.

Important: Rust does not manage the memory of the transaction. To properly free it, use rorm_transaction_commit or [rorm_transaction_abort].

This function is called from an asynchronous context.