MCPcopy Create free account
hub / github.com/chatmail/core / query_map_vec

Method query_map_vec

src/sql.rs:396–407  ·  view source on GitHub ↗

Prepares and executes the statement and maps a function over the resulting rows. Collects the resulting rows into a `Vec`.

(
        &self,
        sql: &str,
        params: impl rusqlite::Params + Send,
        f: F,
    )

Source from the content-addressed store, hash-verified

394 ///
395 /// Collects the resulting rows into a `Vec`.
396 pub async fn query_map_vec<T, F>(
397 &self,
398 sql: &str,
399 params: impl rusqlite::Params + Send,
400 f: F,
401 ) -> Result<Vec<T>>
402 where
403 T: Send + 'static,
404 F: Send + FnMut(&rusqlite::Row) -> Result<T>,
405 {
406 self.query_map_collect(sql, params, f).await
407 }
408
409 /// Used for executing `SELECT COUNT` statements only. Returns the resulting count.
410 pub async fn count(&self, query: &str, params: impl rusqlite::Params + Send) -> Result<usize> {

Callers 15

download_msgsFunction · 0.80
get_storage_usageFunction · 0.80
get_all_self_addrsMethod · 0.80
get_all_ui_config_keysFunction · 0.80
get_all_blockedMethod · 0.80
send_smtp_messagesFunction · 0.80
send_mdn_rfc724_midFunction · 0.80
get_similar_chat_idsMethod · 0.80
sync_contactsMethod · 0.80

Calls 1

query_map_collectMethod · 0.80

Tested by 1

get_smtp_rows_for_msgMethod · 0.64