Executes a query which is expected to return one row and one column. If the query does not return any rows, returns `Ok(None)`.
(
&self,
query: &str,
params: impl rusqlite::Params + Send,
)
| 549 | /// Executes a query which is expected to return one row and one |
| 550 | /// column. If the query does not return any rows, returns `Ok(None)`. |
| 551 | pub async fn query_get_value<T>( |
| 552 | &self, |
| 553 | query: &str, |
| 554 | params: impl rusqlite::Params + Send, |
| 555 | ) -> Result<Option<T>> |
| 556 | where |
| 557 | T: rusqlite::types::FromSql + Send + 'static, |
| 558 | { |
| 559 | self.query_row_optional(query, params, |row| row.get::<_, T>(0)) |
| 560 | .await |
| 561 | } |
| 562 | |
| 563 | /// Set private configuration options. |
| 564 | /// |