pub struct Change {
pub operation: ChangeOp,
pub table: String,
pub id: Value,
pub fields: Option<HashMap<String, Value>>,
}Expand description
A database-agnostic change event for incremental sync.
This type represents a change (INSERT/UPDATE/DELETE) from a source database in a shared IR that can be converted to any target database format.
Fields§
§operation: ChangeOpThe operation type (Create/Update/Delete)
table: StringThe table name
id: ValueThe record ID
fields: Option<HashMap<String, Value>>Field values (None for Delete operations)
Implementations§
Source§impl Change
impl Change
Sourcepub fn new(
operation: ChangeOp,
table: impl Into<String>,
id: Value,
fields: Option<HashMap<String, Value>>,
) -> Self
pub fn new( operation: ChangeOp, table: impl Into<String>, id: Value, fields: Option<HashMap<String, Value>>, ) -> Self
Create a new change.
Sourcepub fn create(
table: impl Into<String>,
id: Value,
fields: HashMap<String, Value>,
) -> Self
pub fn create( table: impl Into<String>, id: Value, fields: HashMap<String, Value>, ) -> Self
Create a CREATE change.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Change
impl<'de> Deserialize<'de> for Change
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Change
Auto Trait Implementations§
impl Freeze for Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnsafeUnpin for Change
impl UnwindSafe for Change
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