pub struct Statement { /* private fields */ }
Expand description
A cached prepared statement.
Implementations§
Source§impl Statement
impl Statement
Sourcepub async fn execute(&mut self, params: impl IntoParams) -> Result<usize>
pub async fn execute(&mut self, params: impl IntoParams) -> Result<usize>
Execute queries on the statement, check [Connection::execute
] for usage.
Sourcepub async fn query(&mut self, params: impl IntoParams) -> Result<Rows>
pub async fn query(&mut self, params: impl IntoParams) -> Result<Rows>
Execute a query on the statement, check [Connection::query
] for usage.
Sourcepub async fn run(&mut self, params: impl IntoParams) -> Result<()>
pub async fn run(&mut self, params: impl IntoParams) -> Result<()>
Run a query on the statement.
The execute()
method returns an error if the query returns rows, which makes
it unsuitable for running any type of SQL queries. Similarly, the query()
method
only works on SQL statements that return rows. Therefore, the run()
method is
provided to execute any type of SQL statement.
Note: This is an extension to the Rusqlite API.
Sourcepub async fn query_row(&mut self, params: impl IntoParams) -> Result<Row>
pub async fn query_row(&mut self, params: impl IntoParams) -> Result<Row>
Sourcepub fn parameter_count(&self) -> usize
pub fn parameter_count(&self) -> usize
Fetch the amount of parameters in the prepared statement.
Sourcepub fn parameter_name(&self, idx: i32) -> Option<&str>
pub fn parameter_name(&self, idx: i32) -> Option<&str>
Fetch the parameter name at the provided index.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Fetch the number of columns for the prepared statement.
Auto Trait Implementations§
impl Freeze for Statement
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T
in a tonic::Request