pub async fn fetch<T>(client: &Client, params: T) -> Result<T, Error>
Expand description
§fetch
Retrieves a single record from the database and converts it to a struct.
§Parameters
client
: Database connection objectparams
: Data object containing query parameters (must implement SqlQuery, FromRow, and SqlParams traits)
§Return Value
Result<T, Error>
: On success, returns the retrieved record as a struct; on failure, returns Error