Trait kip_sql::storage::Transaction
source · pub trait Transaction: Sync + Send + 'static {
type IterType<'a>: Iter;
Show 14 methods
// Required methods
fn read(
&self,
table_name: Arc<String>,
bounds: (Option<usize>, Option<usize>),
projection: Vec<ScalarExpression>
) -> Result<Self::IterType<'_>, StorageError>;
fn read_by_index(
&self,
table_name: Arc<String>,
bounds: (Option<usize>, Option<usize>),
projection: Vec<ScalarExpression>,
index_meta: IndexMetaRef,
binaries: Vec<ConstantBinary>
) -> Result<IndexIter<'_>, StorageError>;
fn add_index(
&mut self,
table_name: &str,
index: Index,
tuple_ids: Vec<TupleId>,
is_unique: bool
) -> Result<(), StorageError>;
fn del_index(
&mut self,
table_name: &str,
index: &Index
) -> Result<(), StorageError>;
fn append(
&mut self,
table_name: &str,
tuple: Tuple,
is_overwrite: bool
) -> Result<(), StorageError>;
fn delete(
&mut self,
table_name: &str,
tuple_id: TupleId
) -> Result<(), StorageError>;
fn add_column(
&mut self,
table_name: &Arc<String>,
column: &ColumnCatalog,
if_not_exists: bool
) -> Result<ColumnId, StorageError>;
fn drop_column(
&mut self,
table_name: &Arc<String>,
column: &str,
if_exists: bool
) -> Result<(), StorageError>;
fn create_table(
&mut self,
table_name: Arc<String>,
columns: Vec<ColumnCatalog>,
if_not_exists: bool
) -> Result<Arc<String>, StorageError>;
fn drop_table(
&mut self,
table_name: &str,
if_exists: bool
) -> Result<(), StorageError>;
fn drop_data(&mut self, table_name: &str) -> Result<(), StorageError>;
fn table(&self, table_name: Arc<String>) -> Option<&TableCatalog>;
fn show_tables(&self) -> Result<Vec<String>, StorageError>;
async fn commit(self) -> Result<(), StorageError>;
}
Required Associated Types§
Required Methods§
sourcefn read(
&self,
table_name: Arc<String>,
bounds: (Option<usize>, Option<usize>),
projection: Vec<ScalarExpression>
) -> Result<Self::IterType<'_>, StorageError>
fn read( &self, table_name: Arc<String>, bounds: (Option<usize>, Option<usize>), projection: Vec<ScalarExpression> ) -> Result<Self::IterType<'_>, StorageError>
The bounds is applied to the whole data batches, not per batch.
The projections is column indices.
fn read_by_index( &self, table_name: Arc<String>, bounds: (Option<usize>, Option<usize>), projection: Vec<ScalarExpression>, index_meta: IndexMetaRef, binaries: Vec<ConstantBinary> ) -> Result<IndexIter<'_>, StorageError>
fn add_index( &mut self, table_name: &str, index: Index, tuple_ids: Vec<TupleId>, is_unique: bool ) -> Result<(), StorageError>
fn del_index( &mut self, table_name: &str, index: &Index ) -> Result<(), StorageError>
fn append( &mut self, table_name: &str, tuple: Tuple, is_overwrite: bool ) -> Result<(), StorageError>
fn delete( &mut self, table_name: &str, tuple_id: TupleId ) -> Result<(), StorageError>
fn add_column( &mut self, table_name: &Arc<String>, column: &ColumnCatalog, if_not_exists: bool ) -> Result<ColumnId, StorageError>
fn drop_column( &mut self, table_name: &Arc<String>, column: &str, if_exists: bool ) -> Result<(), StorageError>
fn create_table( &mut self, table_name: Arc<String>, columns: Vec<ColumnCatalog>, if_not_exists: bool ) -> Result<Arc<String>, StorageError>
fn drop_table( &mut self, table_name: &str, if_exists: bool ) -> Result<(), StorageError>
fn drop_data(&mut self, table_name: &str) -> Result<(), StorageError>
fn table(&self, table_name: Arc<String>) -> Option<&TableCatalog>
fn show_tables(&self) -> Result<Vec<String>, StorageError>
async fn commit(self) -> Result<(), StorageError>
Object Safety§
This trait is not object safe.