pub async fn select<T, F, R>(
client: &Client,
entity: T,
to_model: F,
) -> Result<R, Error>
Expand description
§select
Retrieves a single record from the database using a custom transformation function. This is useful when you want to use a custom transformation function instead of the FromRow trait.
§Parameters
client
: Database connection objectentity
: Query parameter object (must implement SqlQuery and SqlParams traits)to_model
: Function to convert a Row object to the target object type
§Return Value
Result<R, Error>
: On success, returns the transformed object; on failure, returns Error