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>
Establishes a connection (or pool) to the database specified by the URL. Read more
Source§fn begin(&mut self) -> impl Future<Output = Result<SQLiteTransaction<'_>>>
fn begin(&mut self) -> impl Future<Output = Result<SQLiteTransaction<'_>>>
Starts a new transaction on this connection. Read more
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>>
Internal hook for implementing prepared statement support.
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
Executes a query and streams the results (rows or affected counts).
Source§fn accepts_multiple_statements(&self) -> bool
fn accepts_multiple_statements(&self) -> bool
Checks if the driver supports multiple SQL statements in a single request.
Source§fn driver(&self) -> Self::Driverwhere
Self: Sized,
fn driver(&self) -> Self::Driverwhere
Self: Sized,
Returns the driver instance associated with this executor.
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
Prepares a query for execution, returning a handle to the prepared statement.
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
Executes a query and streams the resulting rows, ignoring affected counts.
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
Executes a query and returns the total number of 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 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