Function fetch

Source
pub async fn fetch<P, R>(
    transaction: &Transaction<'_>,
    params: P,
) -> Result<R, Error>
where P: SqlQuery<R> + SqlParams + Send + Sync + 'static, R: FromRow + Send + Sync + 'static,
Expand description

§fetch

Retrieves a single record from the database within a transaction.

§Parameters

  • transaction: Transaction object
  • params: Query parameters (must implement SqlQuery and SqlParams traits)

§Return Value

  • Result<R, Error>: On success, returns the retrieved record; on failure, returns Error