Commit the [`Transaction`].
(mut self)
| 492 | |
| 493 | /// Commit the [`Transaction`]. |
| 494 | pub async fn commit(mut self) -> Result<(), SqlServerError> { |
| 495 | static COMMIT_QUERY: &str = "COMMIT TRANSACTION"; |
| 496 | // N.B. Mark closed _before_ running the query. This prevents us from |
| 497 | // double closing the transaction if this query itself fails. |
| 498 | self.closed = true; |
| 499 | self.client.simple_query(COMMIT_QUERY).await?; |
| 500 | Ok(()) |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | impl Drop for Transaction<'_> { |