Trait risinglight::storage::Transaction
source · pub trait Transaction: Sync + Send + 'static {
type TxnIteratorType: TxnIterator;
type RowHandlerType: RowHandler;
fn scan<'a>(
&'a self,
begin_sort_key: &'a [DataValue],
end_sort_key: &'a [DataValue],
col_idx: &'a [StorageColumnRef],
is_sorted: bool,
reversed: bool,
expr: Option<BoundExpr>
) -> impl Future<Output = StorageResult<Self::TxnIteratorType>> + Send + 'a;
fn append(
&mut self,
columns: DataChunk
) -> impl Future<Output = StorageResult<()>> + Send + '_;
fn delete<'a>(
&'a mut self,
id: &'a Self::RowHandlerType
) -> impl Future<Output = StorageResult<()>> + Send + 'a;
fn commit(self) -> impl Future<Output = StorageResult<()>> + Send;
fn abort(self) -> impl Future<Output = StorageResult<()>> + Send;
}
Expand description
Represents a transaction in storage engine.
Dropping a Transaction
implicitly aborts it.
Required Associated Types§
sourcetype TxnIteratorType: TxnIterator
type TxnIteratorType: TxnIterator
Type of the table iterator
sourcetype RowHandlerType: RowHandler
type RowHandlerType: RowHandler
Type of the unique reference to a row
Required Methods§
sourcefn scan<'a>(
&'a self,
begin_sort_key: &'a [DataValue],
end_sort_key: &'a [DataValue],
col_idx: &'a [StorageColumnRef],
is_sorted: bool,
reversed: bool,
expr: Option<BoundExpr>
) -> impl Future<Output = StorageResult<Self::TxnIteratorType>> + Send + 'a
fn scan<'a>(
&'a self,
begin_sort_key: &'a [DataValue],
end_sort_key: &'a [DataValue],
col_idx: &'a [StorageColumnRef],
is_sorted: bool,
reversed: bool,
expr: Option<BoundExpr>
) -> impl Future<Output = StorageResult<Self::TxnIteratorType>> + Send + 'a
Scan one or multiple columns.
sourcefn append(
&mut self,
columns: DataChunk
) -> impl Future<Output = StorageResult<()>> + Send + '_
fn append(
&mut self,
columns: DataChunk
) -> impl Future<Output = StorageResult<()>> + Send + '_
Append data to the table. Generally, columns
should be in the same order as
ColumnCatalog
when constructing the Table
.
sourcefn delete<'a>(
&'a mut self,
id: &'a Self::RowHandlerType
) -> impl Future<Output = StorageResult<()>> + Send + 'a
fn delete<'a>(
&'a mut self,
id: &'a Self::RowHandlerType
) -> impl Future<Output = StorageResult<()>> + Send + 'a
Delete a record.