pub struct ExecResult { /* private fields */ }Expand description
Execution result for DML operations (INSERT, UPDATE, DELETE)
This result type tracks the number of rows affected and the last insert ID for auto-increment columns.
OPTIMIZATION: Uses static empty values for columns and empty_row to avoid allocations on every DML operation (was causing 40K+ allocations per benchmark).
Implementations§
Source§impl ExecResult
impl ExecResult
Sourcepub fn with_rows_affected(rows_affected: i64) -> Self
pub fn with_rows_affected(rows_affected: i64) -> Self
Create a result with just rows affected
Sourcepub fn with_last_insert_id(rows_affected: i64, last_insert_id: i64) -> Self
pub fn with_last_insert_id(rows_affected: i64, last_insert_id: i64) -> Self
Create a result with rows affected and last insert ID
Trait Implementations§
Source§impl QueryResult for ExecResult
impl QueryResult for ExecResult
Source§fn scan(&self, _dest: &mut [Value]) -> Result<()>
fn scan(&self, _dest: &mut [Value]) -> Result<()>
Scans the current row into the provided values Read more
Source§fn rows_affected(&self) -> i64
fn rows_affected(&self) -> i64
Returns the number of rows affected by an INSERT, UPDATE, or DELETE
Source§fn last_insert_id(&self) -> i64
fn last_insert_id(&self) -> i64
Returns the last inserted ID for an INSERT operation
Source§fn with_aliases(
self: Box<Self>,
_aliases: FxHashMap<String, String>,
) -> Box<dyn QueryResult>
fn with_aliases( self: Box<Self>, _aliases: FxHashMap<String, String>, ) -> Box<dyn QueryResult>
Sets column aliases for this result Read more
Source§fn columns_arc(&self) -> Option<CompactArc<Vec<String>>>
fn columns_arc(&self) -> Option<CompactArc<Vec<String>>>
Returns column names as Arc for zero-copy sharing Read more
Source§fn try_into_arc_rows(&mut self) -> Option<CompactArc<Vec<Row>>>
fn try_into_arc_rows(&mut self) -> Option<CompactArc<Vec<Row>>>
Try to extract all rows as
CompactArc<Vec<Row>> for zero-copy joins Read moreSource§fn estimated_count(&self) -> Option<usize>
fn estimated_count(&self) -> Option<usize>
Returns an estimate of the total number of rows in the result. Read more
Source§fn supports_typed_batches(&self) -> bool
fn supports_typed_batches(&self) -> bool
Whether the result can yield decoded typed column batches without
constructing a row/value object for every result record. Read more
Source§fn typed_batch_fallback_reason(&self) -> Option<TypedBatchFallbackReason>
fn typed_batch_fallback_reason(&self) -> Option<TypedBatchFallbackReason>
If
supports_typed_batches() is false, return the best semantic reason. Read moreSource§fn next_typed_batch(&mut self) -> Result<Option<TypedColumnBatch>, Error>
fn next_typed_batch(&mut self) -> Result<Option<TypedColumnBatch>, Error>
Advance to the next typed column batch. Read more
Auto Trait Implementations§
impl Freeze for ExecResult
impl RefUnwindSafe for ExecResult
impl Send for ExecResult
impl Sync for ExecResult
impl Unpin for ExecResult
impl UnsafeUnpin for ExecResult
impl UnwindSafe for ExecResult
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