Function rorm::rorm_db_delete
source · #[no_mangle]
pub extern "C" fn rorm_db_delete(
db: &'static Database,
transaction: Option<&'static mut Transaction>,
model: FFIString<'static>,
condition: Option<&'static FFICondition<'_>>,
callback: Option<unsafe extern "C" fn(_: usize, _: u64, _: Error<'_>)>,
context: usize
)
Expand description
This function deletes rows from the database based on the given conditions.
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.condition
: Pointer to a [Condition].callback
: callback function. Takes thecontext
, a pointer to a vec of rows and an Error.context
: Pass through void pointer.
Returns the rows affected of the delete statement. Note that this also includes relations, etc.
Important:
- Make sure that
db
,model
andcondition
are allocated until the callback is executed.
This function is called from an asynchronous context.