Used for executing `SELECT COUNT` statements only. Returns the resulting count.
(&self, query: &str, params: impl rusqlite::Params + Send)
| 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> { |
| 411 | let count: isize = self.query_row(query, params, |row| row.get(0)).await?; |
| 412 | Ok(usize::try_from(count)?) |
| 413 | } |
| 414 | |
| 415 | /// Used for executing `SELECT COUNT` statements only. Returns `true`, if the count is at least |
| 416 | /// one, `false` otherwise. |