pub struct Statement { /* private fields */ }
Expand description
A prepared statement.
Implementations§
source§impl Statement
impl Statement
pub fn query_map<F, T>(&self, params: &Params, f: F) -> Result<MappedRows<F>>where F: FnMut(Row) -> Result<T>,
pub fn query(&self, params: &Params) -> Result<Rows>
pub fn query_row(&self, params: &Params) -> Result<Row>
pub fn bind(&self, params: &Params)
pub fn parameter_count(&self) -> usize
pub fn parameter_name(&self, index: i32) -> Option<&str>
pub fn is_explain(&self) -> i32
pub fn readonly(&self) -> bool
pub fn execute(&self, params: &Params) -> Result<u64>
pub fn bind_value(&self, i: i32, param: ValueRef<'_>)
pub fn get_status(&self, status: i32) -> i32
pub fn value_ref(inner: &Statement, col: usize) -> ValueRef<'_>
source§impl Statement
impl Statement
sourcepub fn column_names(&self) -> Vec<&str>
pub fn column_names(&self) -> Vec<&str>
Get all the column names in the result set of the prepared statement.
If associated DB schema can be altered concurrently, you should make sure that current statement has already been stepped once before calling this method.
sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Return the number of columns in the result set returned by the prepared statement.
If associated DB schema can be altered concurrently, you should make sure that current statement has already been stepped once before calling this method.
sourcepub fn column_name(&self, col: usize) -> Option<&str>
pub fn column_name(&self, col: usize) -> Option<&str>
Returns the name assigned to a particular column in the result set returned by the prepared statement.
If associated DB schema can be altered concurrently, you should make sure that current statement has already been stepped once before calling this method.
Returns None
if there is no column at the provided index.
pub fn column_origin_name(&self, col: usize) -> Option<&str>
pub fn column_table_name(&self, col: usize) -> Option<&str>
pub fn column_database_name(&self, col: usize) -> Option<&str>
pub fn column_decltype(&self, col: usize) -> Option<&str>
sourcepub fn column_index(&self, name: &str) -> Result<usize>
pub fn column_index(&self, name: &str) -> Result<usize>
Returns the column index in the result set for a given column name.
If there is no AS clause then the name of the column is unspecified and may change from one release of SQLite to the next.
If associated DB schema can be altered concurrently, you should make sure that current statement has already been stepped once before calling this method.
Failure
Will return an Error::InvalidColumnName
when there is no column with
the specified name
.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnwindSafe for Statement
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request