pub struct ChangeInfo { /* private fields */ }Expand description
Information about an INSERT/UPDATE/DELETE on a virtual table.
Implementations§
Source§impl ChangeInfo
impl ChangeInfo
Sourcepub fn change_type(&self) -> ChangeType
pub fn change_type(&self) -> ChangeType
Returns the type of update being performed.
Sourcepub fn rowid(&self) -> &ValueRef
pub fn rowid(&self) -> &ValueRef
Returns the rowid (or, for WITHOUT ROWID tables, the PRIMARY KEY column) of the row being deleted or updated.
Semantically, an UPDATE to a virtual table is identical to a DELETE followed by an INSERT. In that sense, this method returns the rowid or PRIMARY KEY column of the row being deleted. The rowid of the row being inserted is available as the first element in args.
For the mutable version, see rowid_mut.
Sourcepub fn args(&self) -> &[&ValueRef]
pub fn args(&self) -> &[&ValueRef]
Returns the arguments for an INSERT or UPDATE. The meaning of the first element in this slice depends on the type of change being performed:
- For an INSERT on a WITHOUT ROWID table, the first element is always NULL. The PRIMARY KEY is listed among the remaining elements.
- For an INSERT on a regular table, if the first element is NULL, it indicates that a rowid must be generated and returned from UpdateVTab::update. Otherwise, the first element is the rowid.
- For an UPDATE, the first element is the new value for the rowid or PRIMARY KEY column.
In all cases, the second and following elements correspond to the values for all columns in the order declared in the virtual table’s schema (returned by VTab::connect / CreateVTab::create).
For the mutable version, see args_mut.
Sourcepub fn conflict_mode(&self) -> ConflictMode
pub fn conflict_mode(&self) -> ConflictMode
Return the ON CONFLICT mode of the current SQL statement. In order for this method to be useful, the virtual table needs to have previously enabled ON CONFLICT support using VTabConnection::enable_constraints.
Requires SQLite 3.7.7. On earlier versions, this will always return ConflictMode::Abort.