pub struct PreparedStatement { /* private fields */ }Expand description
A prepared statement for parameterized query execution.
PreparedStatement stores the server-side statement handle and parameter values. Execution is performed by Connection, not by PreparedStatement itself.
§Example
Implementations§
Source§impl PreparedStatement
impl PreparedStatement
Sourcepub fn parameter_count(&self) -> usize
pub fn parameter_count(&self) -> usize
Get the number of parameters in this prepared statement.
Sourcepub fn parameter_types(&self) -> &[DataType]
pub fn parameter_types(&self) -> &[DataType]
Get the parameter types (if available from server).
Sourcepub fn bind(
&mut self,
index: usize,
value: impl Into<Parameter>,
) -> Result<(), QueryError>
pub fn bind( &mut self, index: usize, value: impl Into<Parameter>, ) -> Result<(), QueryError>
Sourcepub fn clear_parameters(&mut self)
pub fn clear_parameters(&mut self)
Clear all bound parameters.
Sourcepub fn parameters(&self) -> &[Option<Parameter>]
pub fn parameters(&self) -> &[Option<Parameter>]
Get bound parameters.
Sourcepub fn build_parameters_data(
&self,
) -> Result<Option<Vec<Vec<Value>>>, QueryError>
pub fn build_parameters_data( &self, ) -> Result<Option<Vec<Vec<Value>>>, QueryError>
Build parameters data in column-major format for the protocol.
This is used internally by Connection when executing prepared statements.
Trait Implementations§
Source§impl Debug for PreparedStatement
impl Debug for PreparedStatement
Auto Trait Implementations§
impl Freeze for PreparedStatement
impl RefUnwindSafe for PreparedStatement
impl Send for PreparedStatement
impl Sync for PreparedStatement
impl Unpin for PreparedStatement
impl UnsafeUnpin for PreparedStatement
impl UnwindSafe for PreparedStatement
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