pub trait Statement<'conn> {
// Required methods
fn add(&mut self) -> &mut Self
where Self: Sized;
fn bind_index<T>(&mut self, index: u32, value: T) -> &mut Self
where Self: Sized;
fn bind_name<T>(&mut self, name: &str, value: T) -> &mut Self
where Self: Sized;
fn bind_null_index(&mut self, index: u32) -> &mut Self
where Self: Sized;
fn bind_null_name(&mut self, name: &str) -> &mut Self
where Self: Sized;
fn execute<T: SQLResult>(&self) -> Result<T>
where Self: Sized;
// Provided methods
fn return_generated_values(&mut self, columns: &[&str]) -> &mut Self
where Self: Sized { ... }
fn fetch_size(&mut self, rows: u32) -> &mut Self
where Self: Sized { ... }
}
Expand description
Represents an executable statement
Required Methods§
fn add(&mut self) -> &mut Selfwhere
Self: Sized,
fn bind_index<T>(&mut self, index: u32, value: T) -> &mut Selfwhere
Self: Sized,
fn bind_name<T>(&mut self, name: &str, value: T) -> &mut Selfwhere
Self: Sized,
fn bind_null_index(&mut self, index: u32) -> &mut Selfwhere
Self: Sized,
fn bind_null_name(&mut self, name: &str) -> &mut Selfwhere
Self: Sized,
fn execute<T: SQLResult>(&self) -> Result<T>where
Self: Sized,
Provided Methods§
Sourcefn return_generated_values(&mut self, columns: &[&str]) -> &mut Selfwhere
Self: Sized,
fn return_generated_values(&mut self, columns: &[&str]) -> &mut Selfwhere
Self: Sized,
Configures Statement to return the generated values from any rows created by this Statement in the SQLResult returned from [execute()]. If no columns are specified, implementations are free to choose which columns will be returned. If called multiple times, only the columns requested in the final invocation will be returned.
The default implementation of this method is a no-op.
Sourcefn fetch_size(&mut self, rows: u32) -> &mut Selfwhere
Self: Sized,
fn fetch_size(&mut self, rows: u32) -> &mut Selfwhere
Self: Sized,
Configures Statement to retrieve a fixed number of rows when fetching results from a query instead deriving fetch size from back pressure. If called multiple times, only the fetch size configured in the final invocation will be applied. If the value specified is zero, then the hint is ignored. The default implementation of this method is a no op and the default value is zero.