pub struct SQLiteConnection { /* private fields */ }Expand description
Wrapper for a SQLite sqlite3 connection pointer used by the SQLite driver.
Provides helpers to prepare/execute statements and stream results into tank_core result types.
Implementations§
Source§impl SQLiteConnection
impl SQLiteConnection
pub fn last_error(&self) -> String
Trait Implementations§
Source§impl Connection for SQLiteConnection
impl Connection for SQLiteConnection
Source§async fn connect(driver: &SQLiteDriver, url: Cow<'static, str>) -> Result<Self>
async fn connect(driver: &SQLiteDriver, url: Cow<'static, str>) -> Result<Self>
Create a connection (or pool) to the given URL. Read more
Source§fn begin(&mut self) -> impl Future<Output = Result<SQLiteTransaction<'_>>>
fn begin(&mut self) -> impl Future<Output = Result<SQLiteTransaction<'_>>>
Begin a transaction scope tied to this connection. Read more
fn sanitize_url(
_driver: &Self::Driver,
url: Cow<'static, str>,
) -> Result<Url, Error>where
Self: Sized,
Source§impl Executor for SQLiteConnection
impl Executor for SQLiteConnection
Source§type Driver = SQLiteDriver
type Driver = SQLiteDriver
Associated driver.
Source§async fn do_prepare(&mut self, sql: String) -> Result<Query<SQLiteDriver>>
async fn do_prepare(&mut self, sql: String) -> Result<Query<SQLiteDriver>>
Actual implementation for
prepare.Source§fn run<'s>(
&'s mut self,
query: impl AsQuery<SQLiteDriver> + 's,
) -> impl Stream<Item = Result<QueryResult>> + Send
fn run<'s>( &'s mut self, query: impl AsQuery<SQLiteDriver> + 's, ) -> impl Stream<Item = Result<QueryResult>> + Send
Execute a query, streaming
QueryResult (rows or affected counts).Source§fn accepts_multiple_statements(&self) -> bool
fn accepts_multiple_statements(&self) -> bool
Supports multiple statements per request.
Source§fn prepare<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Future<Output = Result<Query<Self::Driver>, Error>> + Send
fn prepare<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Future<Output = Result<Query<Self::Driver>, Error>> + Send
Prepare query.
Source§fn fetch<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Stream<Item = Result<Row, Error>> + Send
fn fetch<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Stream<Item = Result<Row, Error>> + Send
Execute a query yielding
Row from the resulting stream (filtering out RowsAffected).Source§fn execute<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Future<Output = Result<RowsAffected, Error>> + Send
fn execute<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Future<Output = Result<RowsAffected, Error>> + Send
Execute and aggregate affected rows counter.
Auto Trait Implementations§
impl Freeze for SQLiteConnection
impl RefUnwindSafe for SQLiteConnection
impl Send for SQLiteConnection
impl Sync for SQLiteConnection
impl Unpin for SQLiteConnection
impl UnsafeUnpin for SQLiteConnection
impl UnwindSafe for SQLiteConnection
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