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(url: Cow<'static, str>) -> Result<SQLiteConnection>
async fn connect(url: Cow<'static, str>) -> Result<SQLiteConnection>
Create a connection (or pool) with at least one underlying session
established 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 the current connection. Read more
fn sanitize_url(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 prepare(&mut self, sql: String) -> Result<Query<Self::Driver>>
async fn prepare(&mut self, sql: String) -> Result<Query<Self::Driver>>
Prepare a query for later execution.
Source§fn run<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Stream<Item = Result<QueryResult>> + Send
fn run<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Stream<Item = Result<QueryResult>> + Send
Run a query, streaming
QueryResult items.Source§fn accepts_multiple_statements(&self) -> bool
fn accepts_multiple_statements(&self) -> bool
Returns true if the executor accepts multiple SQL statements in a single
request (e.g.
CREATE; INSERT; SELECT). Defaults to true.Source§fn fetch<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Stream<Item = Result<RowLabeled, Error>> + Send
fn fetch<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Stream<Item = Result<RowLabeled, Error>> + Send
Stream only labeled rows (filters non-row results).
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.
Auto Trait Implementations§
impl Freeze for SQLiteConnection
impl RefUnwindSafe for SQLiteConnection
impl Send for SQLiteConnection
impl Sync for SQLiteConnection
impl Unpin 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