Rollback a table to a specific snapshot.
(
&self,
identifier: &Identifier,
snapshot_id: i64,
)
| 480 | |
| 481 | /// Rollback a table to a specific snapshot. |
| 482 | pub async fn rollback_to_snapshot( |
| 483 | &self, |
| 484 | identifier: &Identifier, |
| 485 | snapshot_id: i64, |
| 486 | ) -> Result<()> { |
| 487 | let database = identifier.database(); |
| 488 | let table = identifier.object(); |
| 489 | validate_non_empty_multi(&[(database, "database name"), (table, "table name")])?; |
| 490 | let path = self.resource_paths.rollback(database, table); |
| 491 | let request = serde_json::json!({ |
| 492 | "instant": { |
| 493 | "type": "snapshot", |
| 494 | "snapshotId": snapshot_id, |
| 495 | } |
| 496 | }); |
| 497 | let _resp: serde_json::Value = self.client.post(&path, &request).await?; |
| 498 | Ok(()) |
| 499 | } |
| 500 | |
| 501 | /// Rollback a table to a specific tag. |
| 502 | pub async fn rollback_to_tag(&self, identifier: &Identifier, tag_name: &str) -> Result<()> { |
no test coverage detected