pub enum PendingOp {
Insert {
key: ObjectKey,
table: &'static str,
columns: Vec<&'static str>,
values: Vec<Value>,
},
Update {
key: ObjectKey,
table: &'static str,
pk_columns: Vec<&'static str>,
pk_values: Vec<Value>,
set_columns: Vec<&'static str>,
set_values: Vec<Value>,
},
Delete {
key: ObjectKey,
table: &'static str,
pk_columns: Vec<&'static str>,
pk_values: Vec<Value>,
},
}Expand description
A pending database operation.
Variants§
Implementations§
Source§impl PendingOp
impl PendingOp
Sourcepub fn to_sql(&self) -> String
pub fn to_sql(&self) -> String
Generate the SQL that would be executed for this operation.
This is useful for testing and debugging. For INSERT, this generates a single-row insert. For DELETE/UPDATE, the SQL matches what would be executed for a single operation.
Returns a descriptive error string for invalid operations (e.g., empty pk_columns for DELETE/UPDATE, empty set_columns for UPDATE).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PendingOp
impl RefUnwindSafe for PendingOp
impl Send for PendingOp
impl Sync for PendingOp
impl Unpin for PendingOp
impl UnsafeUnpin for PendingOp
impl UnwindSafe for PendingOp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).