pub struct PreparedStatement<'c, 'db> { /* private fields */ }Expand description
A prepared SQL statement bound to a Connection.
Implementations§
Source§impl<'c, 'db> PreparedStatement<'c, 'db>
impl<'c, 'db> PreparedStatement<'c, 'db>
Sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Number of positional parameters ($1, $2, …) this statement expects.
Sourcepub fn parameter_count(&self) -> usize
pub fn parameter_count(&self) -> usize
Alias of Self::param_count matching rusqlite’s name.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Number of output columns. Zero for non-SELECT statements.
Sourcepub fn column_names(&self) -> &[String]
pub fn column_names(&self) -> &[String]
Output column names in declaration order.
Sourcepub fn column_name(&self, i: usize) -> Option<&str>
pub fn column_name(&self, i: usize) -> Option<&str>
Output column name at index i, if any.
Sourcepub fn column_index(&self, name: &str) -> Option<usize>
pub fn column_index(&self, name: &str) -> Option<usize>
Position of the column named name, if present.
Sourcepub fn is_explain(&self) -> bool
pub fn is_explain(&self) -> bool
True if the statement is an EXPLAIN.
Sourcepub fn execute(&self, params: &[Value]) -> Result<u64>
pub fn execute(&self, params: &[Value]) -> Result<u64>
Execute the statement; returns rows affected (0 for SELECT/DDL).
Sourcepub fn query(&self, params: &[Value]) -> Result<Rows<'_>>
pub fn query(&self, params: &[Value]) -> Result<Rows<'_>>
Execute and return a stepping Rows<'_> iterator.
Sourcepub fn query_collect(&self, params: &[Value]) -> Result<QueryResult>
pub fn query_collect(&self, params: &[Value]) -> Result<QueryResult>
Execute and return the fully-materialized QueryResult.
Auto Trait Implementations§
impl<'c, 'db> Freeze for PreparedStatement<'c, 'db>
impl<'c, 'db> !RefUnwindSafe for PreparedStatement<'c, 'db>
impl<'c, 'db> !Send for PreparedStatement<'c, 'db>
impl<'c, 'db> !Sync for PreparedStatement<'c, 'db>
impl<'c, 'db> Unpin for PreparedStatement<'c, 'db>
impl<'c, 'db> UnsafeUnpin for PreparedStatement<'c, 'db>
impl<'c, 'db> !UnwindSafe for PreparedStatement<'c, 'db>
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