diff --git a/crates/core/src/db/datastore/traits.rs b/crates/core/src/db/datastore/traits.rs index fe87b403908..c5e97bdadd1 100644 --- a/crates/core/src/db/datastore/traits.rs +++ b/crates/core/src/db/datastore/traits.rs @@ -316,24 +316,10 @@ pub struct TxData { pub(crate) records: Vec, } -pub trait Blob { - fn view(&self) -> &[u8]; -} - pub trait Data: Into { fn view(&self) -> &ProductValue; } -pub trait BlobRow: Send + Sync { - type TableId: Copy; - type RowId: Copy; - - type Blob: Blob; - type BlobRef: Clone; - - fn blob_to_owned(&self, blob_ref: Self::BlobRef) -> Self::Blob; -} - pub trait DataRow: Send + Sync { type RowId: Copy; @@ -358,100 +344,6 @@ pub trait MutTx { fn commit_mut_tx(&self, tx: Self::MutTxId) -> Result>; } -pub trait Blobstore: BlobRow { - type Iter<'a>: Iterator - where - Self: 'a; - - fn iter_blobs(&self, table_id: TableId) -> Result>; - - fn get_blob(&self, table_id: TableId, row_id: Self::RowId) -> Result>; -} - -pub trait MutBlobstore: Blobstore { - fn delete_blob(&self, table_id: TableId, row_id: Self::RowId) -> Result<()>; - - fn insert_blob(&self, table_id: TableId, row: &[u8]) -> Result; -} - -pub trait Datastore: DataRow { - type Iter<'a>: Iterator - where - Self: 'a; - - type IterByColRange<'a, R: RangeBounds>: Iterator - where - Self: 'a; - - type IterByColEq<'a>: Iterator - where - Self: 'a; - - fn iter(&self, table_id: TableId) -> Result>; - - fn iter_by_col_range>( - &self, - table_id: TableId, - col_id: ColId, - range: R, - ) -> Result>; - - fn iter_by_col_eq<'a>( - &'a self, - table_id: TableId, - col_id: ColId, - value: &'a AlgebraicValue, - ) -> Result>; - - fn get(&self, table_id: TableId, row_id: Self::RowId) -> Result>; -} - -pub trait MutDatastore: Datastore { - fn delete(&self, table_id: TableId, row_id: Self::RowId) -> Result<()>; - - fn insert(&self, table_id: TableId, row: ProductValue) -> Result; -} - -pub trait TxBlobstore: BlobRow + Tx { - type Iter<'a>: Iterator - where - Self: 'a; - - fn iter_blobs_tx<'a>(&'a self, tx: &'a Self::TxId, table_id: TableId) -> Result>; - - fn get_blob_tx<'a>( - &'a self, - tx: &'a Self::TxId, - table_id: TableId, - row_id: Self::RowId, - ) -> Result>; -} - -pub trait MutTxBlobstore: TxBlobstore + MutTx { - fn iter_blobs_mut_tx<'a>(&'a self, tx: &'a Self::MutTxId, table_id: TableId) -> Result>; - - fn get_blob_mut_tx<'a>( - &'a self, - tx: &'a Self::MutTxId, - table_id: TableId, - row_id: Self::RowId, - ) -> Result>; - - fn delete_blob_mut_tx<'a>( - &'a self, - tx: &'a mut Self::MutTxId, - table_id: TableId, - row_id: Self::RowId, - ) -> Result<()>; - - fn insert_blob_mut_tx<'a>( - &'a self, - tx: &'a mut Self::MutTxId, - table_id: TableId, - row: &[u8], - ) -> Result; -} - pub trait TxDatastore: DataRow + Tx { type Iter<'a>: Iterator where diff --git a/crates/core/src/db/relational_db.rs b/crates/core/src/db/relational_db.rs index 630cdbadf46..80db98e74a8 100644 --- a/crates/core/src/db/relational_db.rs +++ b/crates/core/src/db/relational_db.rs @@ -100,7 +100,7 @@ impl RelationalDB { last_commit_offset = Some(commit.commit_offset); for transaction in commit.transactions { transaction_offset += 1; - // NOTE: Although I am creating a blobstore transaction in a + // NOTE: Although I am creating a datastore transaction in a // one to one fashion for each message log transaction, this // is just to reduce memory usage while inserting. We don't // really care about inserting these transactionally as long