pub struct Statement { /* private fields */ }Expand description
A parsed SQL statement ready for execution
Implementations§
Source§impl Statement
impl Statement
Sourcepub fn statement_type(&self) -> StatementType
pub fn statement_type(&self) -> StatementType
Get the statement type
Sourcepub fn is_returning(&self) -> bool
pub fn is_returning(&self) -> bool
Check if this is a RETURNING statement
Sourcepub fn set_cursor_id(&mut self, id: u16)
pub fn set_cursor_id(&mut self, id: u16)
Set the cursor ID
Sourcepub fn columns(&self) -> &[ColumnInfo]
pub fn columns(&self) -> &[ColumnInfo]
Get the column metadata
Sourcepub fn set_columns(&mut self, columns: Vec<ColumnInfo>)
pub fn set_columns(&mut self, columns: Vec<ColumnInfo>)
Set column metadata (from server describe)
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Get the number of columns
Sourcepub fn set_executed(&mut self, executed: bool)
pub fn set_executed(&mut self, executed: bool)
Mark the statement as executed
Sourcepub fn binds_changed(&self) -> bool
pub fn binds_changed(&self) -> bool
Check if binds have changed
Sourcepub fn set_binds_changed(&mut self, changed: bool)
pub fn set_binds_changed(&mut self, changed: bool)
Set binds changed flag
Sourcepub fn requires_define(&self) -> bool
pub fn requires_define(&self) -> bool
Check if column define is required
Sourcepub fn set_requires_define(&mut self, required: bool)
pub fn set_requires_define(&mut self, required: bool)
Set requires define flag
Sourcepub fn no_prefetch(&self) -> bool
pub fn no_prefetch(&self) -> bool
Check if prefetch should be disabled
Sourcepub fn set_no_prefetch(&mut self, no_prefetch: bool)
pub fn set_no_prefetch(&mut self, no_prefetch: bool)
Set no prefetch flag
Sourcepub fn set_statement_type(&mut self, stmt_type: StatementType)
pub fn set_statement_type(&mut self, stmt_type: StatementType)
Set the statement type (useful for scroll operations that reuse cursors)
Sourcepub fn clone_for_reuse(&self) -> Self
pub fn clone_for_reuse(&self) -> Self
Clone statement for cache reuse, preserving cursor_id and metadata
This creates a copy of the statement that can be executed with new bind values while reusing the server-side cursor. The cursor_id, column metadata, and bind info are preserved.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnwindSafe for Statement
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)