(
&self,
server_id: &str,
session: &ServerRecentSession,
)
| 490 | .execute(&mut *transaction) |
| 491 | .await?; |
| 492 | } |
| 493 | |
| 494 | sqlx::query(&self.bind_sql( |
| 495 | "UPDATE servers SET server_id = ?, address = ?, hostport = ? WHERE server_id = ?", |
| 496 | )) |
| 497 | .bind(new_server_id) |
| 498 | .bind(new_address) |
| 499 | .bind(i64::from(new_hostport)) |
| 500 | .bind(&old_server_id) |
| 501 | .execute(&mut *transaction) |
| 502 | .await?; |
| 503 | |
| 504 | sqlx::query(&self.bind_sql( |
| 505 | "DELETE FROM server_samples |
| 506 | WHERE server_id = ? AND observed_unix_ms IN ( |
| 507 | SELECT observed_unix_ms FROM server_samples WHERE server_id = ? |
| 508 | )", |
| 509 | )) |
| 510 | .bind(&old_server_id) |
| 511 | .bind(new_server_id) |
| 512 | .execute(&mut *transaction) |
| 513 | .await?; |
| 514 | sqlx::query(&self.bind_sql("UPDATE server_samples SET server_id = ? WHERE server_id = ?")) |
| 515 | .bind(new_server_id) |
| 516 | .bind(&old_server_id) |
| 517 | .execute(&mut *transaction) |
| 518 | .await?; |
| 519 |
no test coverage detected