pub struct RowChange {
pub table: String,
pub op: ChangeOp,
pub columns: Vec<Option<String>>,
/* private fields */
}Expand description
One row change extracted from a changeset.
columns holds the row’s column values in schema order. Inserts and updates
contain the resulting values; deletes contain the removed values. Unchanged
update columns are filled from the old side so primary keys and foreign keys
remain available.
None means SQL NULL or a column absent from the changeset.
Fields§
§table: String§op: ChangeOp§columns: Vec<Option<String>>Implementations§
Source§impl RowChange
impl RowChange
Sourcepub fn new(
table: String,
op: ChangeOp,
columns: Vec<Option<String>>,
changed_columns: Vec<bool>,
) -> Self
pub fn new( table: String, op: ChangeOp, columns: Vec<Option<String>>, changed_columns: Vec<bool>, ) -> Self
Build a row change from equally sized column-value and changed-column vectors. The decoder is the sole producer; keeping the marker beside the decoded row preserves SQLite’s distinction between an unchanged value copied from the old side and a value written by this UPDATE.
Sourcepub fn column_changed(&self, i: usize) -> bool
pub fn column_changed(&self, i: usize) -> bool
Whether this column was written by the change. Inserts and deletes affect
every value in their row; updates mark only values present on SQLite’s new
side, even though Self::col fills unchanged values from the old side.