Execute the function inside a transaction assuming that it does writes. If the function returns an error, the transaction will be rolled back. If it does not return an error, the transaction will be committed.
(&self, callback: G)
| 443 | /// If the function returns an error, the transaction will be rolled back. If it does not return an |
| 444 | /// error, the transaction will be committed. |
| 445 | pub async fn transaction<G, H>(&self, callback: G) -> Result<H> |
| 446 | where |
| 447 | H: Send + 'static, |
| 448 | G: Send + FnOnce(&mut rusqlite::Transaction<'_>) -> Result<H>, |
| 449 | { |
| 450 | let query_only = false; |
| 451 | self.transaction_ex(query_only, callback).await |
| 452 | } |
| 453 | |
| 454 | /// Execute the function inside a transaction. |
| 455 | /// |