pub struct SqlitePreparedStatement { /* private fields */ }Expand description
Handle to a prepared SQLite statement owned by a worker connection.
Instances can be cloned and reused across awaited calls. Dropping the handle
simply releases the reference; the underlying connection will keep the
statement cached via rusqlite’s internal prepare_cached mechanism.
Implementations§
Source§impl SqlitePreparedStatement
impl SqlitePreparedStatement
Sourcepub async fn query(
&self,
params: &[RowValues],
) -> Result<ResultSet, SqlMiddlewareDbError>
pub async fn query( &self, params: &[RowValues], ) -> Result<ResultSet, SqlMiddlewareDbError>
Execute the prepared statement as a query and materialise the rows into a ResultSet.
§Errors
Returns SqlMiddlewareDbError if the underlying worker fails to execute the statement or
if result conversion encounters an issue.
Sourcepub async fn execute(
&self,
params: &[RowValues],
) -> Result<usize, SqlMiddlewareDbError>
pub async fn execute( &self, params: &[RowValues], ) -> Result<usize, SqlMiddlewareDbError>
Execute the prepared statement as a DML (INSERT/UPDATE/DELETE) returning rows affected.
§Errors
Returns SqlMiddlewareDbError if the worker cannot execute the statement or if the result
cannot be converted into the expected row count.
Trait Implementations§
Source§impl Clone for SqlitePreparedStatement
impl Clone for SqlitePreparedStatement
Source§fn clone(&self) -> SqlitePreparedStatement
fn clone(&self) -> SqlitePreparedStatement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SqlitePreparedStatement
impl RefUnwindSafe for SqlitePreparedStatement
impl Send for SqlitePreparedStatement
impl Sync for SqlitePreparedStatement
impl Unpin for SqlitePreparedStatement
impl UnwindSafe for SqlitePreparedStatement
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