Function rorm::rorm_db_query_stream

source ·
#[no_mangle]
pub extern "C" fn rorm_db_query_stream(
    db: &Database,
    transaction: Option<&'static mut Transaction>,
    model: FFIString<'_>,
    columns: FFISlice<'_, FFIColumnSelector<'_>>,
    joins: FFISlice<'static, FFIJoin<'static>>,
    condition: Option<&FFICondition<'_>>,
    order_by: FFISlice<'static, FFIOrderByEntry<'static>>,
    limit: FFIOption<FFILimitClause>,
    callback: Option<unsafe extern "C" fn(_: usize, _: Option<Box<BoxStream<'_, Result<Row, Error>>>>, _: Error<'_>)>,
    context: usize
)
Expand description

This function queries the database given the provided parameter.

Returns a pointer to the created stream.

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.
  • columns: Array of columns to retrieve from the database.
  • joins: Array of joins to add to the query.
  • condition: Pointer to a [Condition].
  • order_by: Array of FFIOrderByEntry.
  • limit: Optional limit / offset to set to the query.
  • callback: callback function. Takes the context, a stream pointer and an Error.
  • context: Pass through void pointer.

This function is called completely synchronously.