pub async fn tx_select<'a, T, R, F>(
transaction: Transaction<'a>,
entity: T,
to_model: F,
) -> Result<(Transaction<'a>, R), Error>
Expand description
§tx_select
Retrieves a single record using a custom transformation function within a transaction.
§Parameters
transaction
: Active transaction objectentity
: Query parameters (must implement SqlQuery and SqlParams traits)to_model
: Function to transform the row into the desired type
§Return Value
Result<(Transaction<'_>, R), Error>
: On success, returns the transaction and the transformed record