pub struct SqlxSqlitePoolConnection { /* private fields */ }
Expand description
Defines a sqlx SQLite pool
Implementations§
source§impl SqlxSqlitePoolConnection
impl SqlxSqlitePoolConnection
sourcepub async fn execute(
&self,
stmt: Statement
) -> impl Future<Output = Result<ExecResult, DbErr>>
pub async fn execute( &self, stmt: Statement ) -> impl Future<Output = Result<ExecResult, DbErr>>
Execute a Statement on a SQLite backend
sourcepub async fn execute_unprepared(
&self,
sql: &str
) -> impl Future<Output = Result<ExecResult, DbErr>>
pub async fn execute_unprepared( &self, sql: &str ) -> impl Future<Output = Result<ExecResult, DbErr>>
Execute an unprepared SQL statement on a SQLite backend
sourcepub async fn query_one(
&self,
stmt: Statement
) -> impl Future<Output = Result<Option<QueryResult>, DbErr>>
pub async fn query_one( &self, stmt: Statement ) -> impl Future<Output = Result<Option<QueryResult>, DbErr>>
Get one result from a SQL query. Returns Option::None if no match was found
sourcepub async fn query_all(
&self,
stmt: Statement
) -> impl Future<Output = Result<Vec<QueryResult, Global>, DbErr>>
pub async fn query_all( &self, stmt: Statement ) -> impl Future<Output = Result<Vec<QueryResult, Global>, DbErr>>
Get the results of a query returning them as a Vec<QueryResult>
sourcepub async fn stream(
&self,
stmt: Statement
) -> impl Future<Output = Result<QueryStream, DbErr>>
pub async fn stream( &self, stmt: Statement ) -> impl Future<Output = Result<QueryStream, DbErr>>
Stream the results of executing a SQL query
sourcepub async fn begin(
&self,
isolation_level: Option<IsolationLevel>,
access_mode: Option<AccessMode>
) -> impl Future<Output = Result<DatabaseTransaction, DbErr>>
pub async fn begin( &self, isolation_level: Option<IsolationLevel>, access_mode: Option<AccessMode> ) -> impl Future<Output = Result<DatabaseTransaction, DbErr>>
Bundle a set of SQL statements that execute together.
sourcepub async fn transaction<F, T, E>(
&self,
callback: F,
isolation_level: Option<IsolationLevel>,
access_mode: Option<AccessMode>
) -> impl Future<Output = Result<T, TransactionError<E>>>where
F: for<'b> FnOnce(&'b DatabaseTransaction) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'b, Global>> + Send,
T: Send,
E: Error + Send,
pub async fn transaction<F, T, E>( &self, callback: F, isolation_level: Option<IsolationLevel>, access_mode: Option<AccessMode> ) -> impl Future<Output = Result<T, TransactionError<E>>>where F: for<'b> FnOnce(&'b DatabaseTransaction) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'b, Global>> + Send, T: Send, E: Error + Send,
Create a MySQL transaction
Trait Implementations§
source§impl Clone for SqlxSqlitePoolConnection
impl Clone for SqlxSqlitePoolConnection
source§fn clone(&self) -> SqlxSqlitePoolConnection
fn clone(&self) -> SqlxSqlitePoolConnection
Returns a copy 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 !RefUnwindSafe for SqlxSqlitePoolConnection
impl Send for SqlxSqlitePoolConnection
impl Sync for SqlxSqlitePoolConnection
impl Unpin for SqlxSqlitePoolConnection
impl !UnwindSafe for SqlxSqlitePoolConnection
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