Function rorm::rorm_db_update
source · #[no_mangle]
pub extern "C" fn rorm_db_update(
db: &'static Database,
transaction: Option<&'static mut Transaction>,
model: FFIString<'static>,
updates: FFISlice<'static, FFIUpdate<'static>>,
condition: Option<&'static FFICondition<'_>>,
callback: Option<unsafe extern "C" fn(_: usize, _: u64, _: Error<'_>)>,
context: usize
)
Expand description
This function updates rows in the database.
Parameter:
db
: Reference to the Database, provided by rorm_db_connect.transaction
: Mutable pointer to a Transaction. Can be a null pointer to ignore this parameter.model
: Name of the table to query.updates
: List of FFIUpdate to apply.condition
: Pointer to a [Condition].callback
: callback function. Takes thecontext
, the rows affected and an Error.context
: Pass through void pointer.
Important:
- Make sure that
db
,model
,updates
andcondition
are allocated until the callback is executed.
This function is called from an asynchronous context.