diff --git a/services/backup/src/database/mod.rs b/services/backup/src/database/mod.rs
index c0a4c938a..a5143b035 100644
--- a/services/backup/src/database/mod.rs
+++ b/services/backup/src/database/mod.rs
@@ -1,360 +1,350 @@
pub mod backup_item;
pub mod log_item;
use self::{
backup_item::{BackupItem, OrderedBackupItem},
log_item::LogItem,
};
use crate::constants::{backup_table, log_table, LOG_DEFAULT_PAGE_SIZE};
use aws_sdk_dynamodb::{
operation::get_item::GetItemOutput,
types::{AttributeValue, DeleteRequest, ReturnValue, WriteRequest},
};
use comm_lib::{
blob::client::BlobServiceClient,
database::{
self, batch_operations::ExponentialBackoffConfig, parse_int_attribute,
Error,
},
};
use tracing::{error, trace, warn};
#[derive(Clone)]
pub struct DatabaseClient {
client: aws_sdk_dynamodb::Client,
}
impl DatabaseClient {
pub fn new(aws_config: &aws_config::SdkConfig) -> Self {
DatabaseClient {
client: aws_sdk_dynamodb::Client::new(aws_config),
}
}
}
/// Backup functions
impl DatabaseClient {
pub async fn put_backup_item(
&self,
backup_item: BackupItem,
) -> Result<(), Error> {
let item = backup_item.into();
self
.client
.put_item()
.table_name(backup_table::TABLE_NAME)
.set_item(Some(item))
.send()
.await
.map_err(|e| {
error!("DynamoDB client failed to put backup item");
Error::AwsSdk(e.into())
})?;
Ok(())
}
pub async fn find_backup_item(
&self,
user_id: &str,
backup_id: &str,
) -> Result