Function tx_select_all

Source
pub async fn tx_select_all<'a, T, R, F>(
    transaction: Transaction<'a>,
    entity: T,
    to_model: F,
) -> Result<(Transaction<'a>, Vec<R>), Error>
where T: SqlQuery + SqlParams, F: Fn(&Row) -> R,
Expand description

§tx_select_all

Retrieves multiple records using a custom transformation function within a transaction.

§Parameters

  • transaction: Active transaction object
  • entity: Query parameters (must implement SqlQuery and SqlParams traits)
  • to_model: Function to transform each row into the desired type

§Return Value

  • Result<(Transaction<'_>, Vec<R>), Error>: On success, returns the transaction and the transformed records