pub struct Statement<'sql> { /* private fields */ }Expand description
Represents SQL statements that can be executed with various options.
Implementations§
Source§impl<'sql> Statement<'sql>
impl<'sql> Statement<'sql>
Sourcepub fn execute(&self, params: &[&dyn ToDbValue]) -> Result<ExecResult, Error>
pub fn execute(&self, params: &[&dyn ToDbValue]) -> Result<ExecResult, Error>
Executes the statement with the given parameters and returns an ExecResult structure. The statement that is executed may not be a query.
Sourcepub fn execute_batch(
&self,
params: BindParameters<'_>,
) -> Result<ExecResult, Error>
pub fn execute_batch( &self, params: BindParameters<'_>, ) -> Result<ExecResult, Error>
Executes a SQL statement against the database multiple times in one round trip.
Sourcepub fn execute_named(
&self,
params: &[(&str, &dyn ToDbValue)],
) -> Result<ExecResult, Error>
pub fn execute_named( &self, params: &[(&str, &dyn ToDbValue)], ) -> Result<ExecResult, Error>
Executes the statement with the given named parameters and returns an ExecResult structure. The statement that is executed may not be a query.
Sourcepub fn exclude_from_cache(&mut self) -> &mut Self
pub fn exclude_from_cache(&mut self) -> &mut Self
Specifies that this statement should not be cached.
Sourcepub fn fetch_array_size(&mut self, value: u32) -> &mut Self
pub fn fetch_array_size(&mut self, value: u32) -> &mut Self
Specifies the number of rows that should be fetched at a time from the database.
Sourcepub fn fetch_lobs(&mut self) -> &mut Self
pub fn fetch_lobs(&mut self) -> &mut Self
Specifies that LOB values should be fetched as LOB locators.
Sourcepub fn prefetch_rows(&mut self, value: u32) -> &mut Self
pub fn prefetch_rows(&mut self, value: u32) -> &mut Self
Specifies the number of rows that should be fetched when the statement is executed.
Sourcepub fn query(&self, params: &[&dyn ToDbValue]) -> Result<Cursor, Error>
pub fn query(&self, params: &[&dyn ToDbValue]) -> Result<Cursor, Error>
Executes the statement with the given parameters and returns a Cursor which can be used to iterate over the rows returned by the query. The statement that is executed must be a query.
Sourcepub fn query_named(
&self,
params: &[(&str, &dyn ToDbValue)],
) -> Result<Cursor, Error>
pub fn query_named( &self, params: &[(&str, &dyn ToDbValue)], ) -> Result<Cursor, Error>
Executes the statement with the given parameters and returns a Cursor which can be used to iterate over the rows returned by the query. The statement that is executed must be a query.