Prepare for delete

This commit is contained in:
Yuriy Dupyn 2024-02-05 21:46:18 +01:00
parent 610d70378e
commit 997162c555
4 changed files with 86 additions and 18 deletions

View file

@ -244,6 +244,16 @@ impl <'cursor, T> WriteCursor<'cursor, T>
Ok(count)
}
pub async fn delete_all_entries(&mut self, enable_garbage_collector: bool) -> Result<usize>
where T: Encode + Decode + Ord + Send + Sync + Clone
{
let count = todo!();
if enable_garbage_collector {
self.attempt_garbage_collection_if_necessary().await?;
}
Ok(count)
}
pub async fn delete_entries_where_eq(&mut self, column: Column, value: &T, enable_garbage_collector: bool) -> Result<usize>
where T: Encode + Decode + Ord + Send + Sync + Clone
{

View file

@ -23,10 +23,6 @@ impl <T>Entry<T> {
Self { header: EntryHeader { is_deleted: false }, data }
}
pub fn new_deleted(data: Vec<T>) -> Self {
Self { header: EntryHeader { is_deleted: true}, data }
}
// FORMAT: [EntryHeaderWithDataSize, ..sequence of data]
pub fn encode(&self) -> Result<Vec<u8>>
where T: Encode