Skip to main content

query_map_collect

Function query_map_collect 

pub fn query_map_collect<T, P, F>(
    db: &FactsDb,
    sql: &str,
    params: P,
    label: &str,
    mapper: F,
) -> Result<Vec<T>>
where P: Params, F: FnMut(&Row<'_>) -> Result<T>,
Expand description

Prepare + query_map + collect, with uniform CodeLoreError::Analysis error context at each step. label is interpolated into the error messages so debug output identifies which analysis failed.

§Errors

Returns CodeLoreError::Analysis on prepare, query, or row-mapping failure; the error message is "<step> <label>: <underlying>".