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,
)
| 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> { |