pub struct CatalogTx { /* private fields */ }Expand description
An atomic catalog transaction: an ordered batch of CatalogOps applied
together against a CatalogStore.
§Examples
let mut tx = CatalogTx::new();
tx.put_row(CatalogRow::new(Symbol::new("registry/libs"), Symbol::new("demo")));
assert_eq!(tx.ops().len(), 1);Implementations§
Source§impl CatalogTx
impl CatalogTx
Sourcepub fn put_row(&mut self, row: CatalogRow)
pub fn put_row(&mut self, row: CatalogRow)
Queues a row insert or replace.
Sourcepub fn delete_row(&mut self, table: Symbol, key: Symbol)
pub fn delete_row(&mut self, table: Symbol, key: Symbol)
Queues deletion of the row at table/key.
Sourcepub fn bump_sequence(&mut self, name: Symbol, reserved: u64)
pub fn bump_sequence(&mut self, name: Symbol, reserved: u64)
Queues reserving reserved ids from the named sequence.
Sourcepub fn validate(&self, store: &CatalogStore) -> Result<()>
pub fn validate(&self, store: &CatalogStore) -> Result<()>
Checks the transaction against store without mutating it, enforcing
table existence, write policies, required fields, and per-row uniqueness.
Sourcepub fn commit(self, store: &mut CatalogStore) -> Result<u64>
pub fn commit(self, store: &mut CatalogStore) -> Result<u64>
Validates and applies the transaction, returning the new catalog epoch and recording an audit event per operation.
Trait Implementations§
impl Eq for CatalogTx
impl StructuralPartialEq for CatalogTx
Auto Trait Implementations§
impl !RefUnwindSafe for CatalogTx
impl !UnwindSafe for CatalogTx
impl Freeze for CatalogTx
impl Send for CatalogTx
impl Sync for CatalogTx
impl Unpin for CatalogTx
impl UnsafeUnpin for CatalogTx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more