Skip to main content

fetch_optional

Function fetch_optional 

Source
pub async fn fetch_optional<'a, T>(
    db: impl Executor<'a>,
    sql: &str,
    binds: &[Value],
) -> Result<Option<T>, Error>
where T: DriverRows + Send + Unpin,
Expand description

Runs a SELECT and returns its first row, decoded as T, or None when no row matches.