Executes the given query, returning the last inserted row ID.
(&self, query: &str, params: impl rusqlite::Params + Send)
| 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> { |
| 342 | self.call_write(move |conn| { |
| 343 | conn.execute(query, params)?; |
| 344 | Ok(conn.last_insert_rowid()) |
| 345 | }) |
| 346 | .await |
| 347 | } |
| 348 | |
| 349 | /// Prepares and executes the statement and maps a function over the resulting rows. |
| 350 | /// Then executes the second function over the returned iterator and returns the |