pub struct DatabaseOverlay { /* private fields */ }Expand description
Manages uncommitted changes during a transaction.
Provides an overlay over the existing database state to track uncommitted inserts, updates, and deletes per table.
Implementations§
Source§impl DatabaseOverlay
impl DatabaseOverlay
Sourcepub fn reader<'a, T, MA>(
&'a mut self,
table_reader: TableReader<'a, T, MA>,
) -> DatabaseOverlayReader<'a, T, MA>where
T: TableSchema,
MA: MemoryAccess,
pub fn reader<'a, T, MA>(
&'a mut self,
table_reader: TableReader<'a, T, MA>,
) -> DatabaseOverlayReader<'a, T, MA>where
T: TableSchema,
MA: MemoryAccess,
Returns a reader that merges base table data with overlay changes.
Sourcepub fn insert<T>(&mut self, values: Vec<(ColumnDef, Value)>) -> DbmsResult<()>where
T: TableSchema,
pub fn insert<T>(&mut self, values: Vec<(ColumnDef, Value)>) -> DbmsResult<()>where
T: TableSchema,
Inserts a record into the overlay for the specified table.
Sourcepub fn update<T>(&mut self, pk: Value, updates: Vec<(&'static str, Value)>)where
T: TableSchema,
pub fn update<T>(&mut self, pk: Value, updates: Vec<(&'static str, Value)>)where
T: TableSchema,
Updates a record in the overlay for the specified table.
Sourcepub fn delete<T>(&mut self, pk: Value)where
T: TableSchema,
pub fn delete<T>(&mut self, pk: Value)where
T: TableSchema,
Deletes a record in the overlay for the specified table.
Trait Implementations§
Source§impl Clone for DatabaseOverlay
impl Clone for DatabaseOverlay
Source§fn clone(&self) -> DatabaseOverlay
fn clone(&self) -> DatabaseOverlay
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DatabaseOverlay
impl Debug for DatabaseOverlay
Source§impl Default for DatabaseOverlay
impl Default for DatabaseOverlay
Source§fn default() -> DatabaseOverlay
fn default() -> DatabaseOverlay
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DatabaseOverlay
impl RefUnwindSafe for DatabaseOverlay
impl Send for DatabaseOverlay
impl Sync for DatabaseOverlay
impl Unpin for DatabaseOverlay
impl UnsafeUnpin for DatabaseOverlay
impl UnwindSafe for DatabaseOverlay
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