pub struct Connection { /* private fields */ }Expand description
An open connection to a SQLite database.
Implementations§
Trait Implementations§
Source§impl Connection for Connection
impl Connection for Connection
Source§fn exec<'life0, 'life1, 'async_trait>(
&'life0 mut self,
schema: &'life1 Arc<Schema>,
op: Operation,
) -> Pin<Box<dyn Future<Output = Result<ExecResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exec<'life0, 'life1, 'async_trait>(
&'life0 mut self,
schema: &'life1 Arc<Schema>,
op: Operation,
) -> Pin<Box<dyn Future<Output = Result<ExecResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Executes a database operation and returns the result. Read more
Source§fn push_schema<'life0, 'life1, 'async_trait>(
&'life0 mut self,
schema: &'life1 Schema,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn push_schema<'life0, 'life1, 'async_trait>(
&'life0 mut self,
schema: &'life1 Schema,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates tables and indices defined in the schema on the database.
TODO: This will probably use database introspection in the future.
Source§fn applied_migrations<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AppliedMigration>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn applied_migrations<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AppliedMigration>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a list of currently applied database migrations.
Source§fn apply_migration<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
id: u64,
name: &'life1 str,
migration: &'life2 Migration,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn apply_migration<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
id: u64,
name: &'life1 str,
migration: &'life2 Migration,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Applies a single migration to the database and records it as applied.
Auto Trait Implementations§
impl !Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl !Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
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