Execute `query` assuming it is a write query, returning the number of affected rows.
(
&self,
query: &str,
params: impl rusqlite::Params + Send,
)
| 326 | |
| 327 | /// Execute `query` assuming it is a write query, returning the number of affected rows. |
| 328 | pub async fn execute( |
| 329 | &self, |
| 330 | query: &str, |
| 331 | params: impl rusqlite::Params + Send, |
| 332 | ) -> Result<usize> { |
| 333 | self.call_write(move |conn| { |
| 334 | let res = conn.execute(query, params)?; |
| 335 | Ok(res) |
| 336 | }) |
| 337 | .await |
| 338 | } |
| 339 | |
| 340 | /// Executes the given query, returning the last inserted row ID. |
| 341 | pub async fn insert(&self, query: &str, params: impl rusqlite::Params + Send) -> Result<i64> { |