pub struct Session { /* private fields */ }Expand description
A session that records database changes for later extraction as a changeset or patchset.
In a real database engine this would hook into the DML pipeline. For now it provides a programmatic API for recording changes and generating the binary changeset/patchset encoding.
Implementations§
Source§impl Session
impl Session
Sourcepub fn attach_table(
&mut self,
name: &str,
column_count: usize,
pk_flags: Vec<bool>,
)
pub fn attach_table( &mut self, name: &str, column_count: usize, pk_flags: Vec<bool>, )
Attach a table for change tracking.
pk_flags indicates which columns are part of the primary key.
Sourcepub fn record_insert(&mut self, table: &str, new_values: Vec<ChangesetValue>)
pub fn record_insert(&mut self, table: &str, new_values: Vec<ChangesetValue>)
Record an INSERT operation.
Sourcepub fn record_delete(&mut self, table: &str, old_values: Vec<ChangesetValue>)
pub fn record_delete(&mut self, table: &str, old_values: Vec<ChangesetValue>)
Record a DELETE operation.
Sourcepub fn record_update(
&mut self,
table: &str,
old_values: Vec<ChangesetValue>,
new_values: Vec<ChangesetValue>,
)
pub fn record_update( &mut self, table: &str, old_values: Vec<ChangesetValue>, new_values: Vec<ChangesetValue>, )
Record an UPDATE operation.
old_values and new_values must have the same length. Use
ChangesetValue::Undefined for columns that did not change.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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