Function get

Source
pub async fn get<T>(client: &Client, params: T) -> Result<T, Error>
where T: SqlQuery + FromRow + SqlParams + Send + Sync + 'static,
👎Deprecated since 0.2.0: Renamed to fetch. Please use fetch function instead.
Expand description

§get

Retrieves a single record from the database and converts it to a struct.

§Deprecated

This function has been renamed to fetch. Please use fetch instead.

§Arguments

  • client - Database connection client
  • params - Query parameters (must implement SqlQuery, FromRow, and SqlParams traits)

§Return Value

  • Result<T, Error> - On success, returns the retrieved record; on failure, returns Error