pub struct SqliteExecutor { /* private fields */ }Implementations§
Source§impl SqliteExecutor
impl SqliteExecutor
pub async fn open(path: impl AsRef<Path>) -> Result<Self, SqliteError>
pub async fn open_with_options( path: impl AsRef<Path>, options: SqliteOptions, ) -> Result<Self, SqliteError>
pub async fn open_in_memory() -> Result<Self, SqliteError>
pub fn connection(&self) -> &Connection
Sourcepub async fn transaction<T, E, F>(
&self,
operation: F,
) -> Result<T, SqliteTransactionError<E>>
pub async fn transaction<T, E, F>( &self, operation: F, ) -> Result<T, SqliteTransactionError<E>>
Run an operation inside a transaction and always complete it.
The operation is committed on success and rolled back on error. If the calling task is cancelled while the operation is running, dropping the transaction schedules a rollback while retaining the connection gate.
Sourcepub async fn execute_schema(
&self,
sql: impl Into<String>,
) -> Result<(), SqliteError>
pub async fn execute_schema( &self, sql: impl Into<String>, ) -> Result<(), SqliteError>
Execute trusted schema SQL. Application values should use typed queries.
Trait Implementations§
Source§impl Clone for SqliteExecutor
impl Clone for SqliteExecutor
Source§fn clone(&self) -> SqliteExecutor
fn clone(&self) -> SqliteExecutor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Executor for SqliteExecutor
impl Executor for SqliteExecutor
type Row = SqliteRow
type Error = SqliteError
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 CompiledQuery,
) -> Pin<Box<dyn Future<Output = Result<ExecuteResult, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_all<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 CompiledQuery,
) -> Pin<Box<dyn Future<Output = Result<QueryResult<Self::Row>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl MigrationBackend for SqliteExecutor
impl MigrationBackend for SqliteExecutor
type Error = SqliteMigrationError
fn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
migrations: &'life1 [PreparedMigration],
) -> Pin<Box<dyn Future<Output = Result<MigrationReport, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl MigrationLedger for SqliteExecutor
impl MigrationLedger for SqliteExecutor
type Error = SqliteMigrationError
fn applied_migrations<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AppliedMigration>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl TransactionManager for SqliteExecutor
impl TransactionManager for SqliteExecutor
type Transaction = SqliteTransaction
fn begin<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Transaction, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteExecutor
impl !UnwindSafe for SqliteExecutor
impl Freeze for SqliteExecutor
impl Send for SqliteExecutor
impl Sync for SqliteExecutor
impl Unpin for SqliteExecutor
impl UnsafeUnpin for SqliteExecutor
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