(
&self,
sandbox_id: &str,
status: &str,
)
| 811 | } |
| 812 | |
| 813 | pub async fn delete_draft_chunks( |
| 814 | &self, |
| 815 | sandbox_id: &str, |
| 816 | status: &str, |
| 817 | ) -> PersistenceResult<u64> { |
| 818 | let result = sqlx::query( |
| 819 | r#" |
| 820 | DELETE FROM "objects" |
| 821 | WHERE "object_type" = ?1 AND "scope" = ?2 AND "status" = ?3 |
| 822 | "#, |
| 823 | ) |
| 824 | .bind(DRAFT_CHUNK_OBJECT_TYPE) |
| 825 | .bind(sandbox_id) |
| 826 | .bind(status) |
| 827 | .execute(&self.pool) |
| 828 | .await |
| 829 | .map_err(|e| map_db_error(&e))?; |
| 830 | Ok(result.rows_affected()) |
| 831 | } |
| 832 | |
| 833 | pub async fn get_draft_version(&self, sandbox_id: &str) -> PersistenceResult<i64> { |
| 834 | let rows = sqlx::query( |
no test coverage detected