Connection

Trait Connection 

Source
pub trait Connection:
    Debug
    + Send
    + 'static {
    // Required methods
    fn exec<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        schema: &'life1 Arc<Schema>,
        plan: Operation,
    ) -> Pin<Box<dyn Future<Output = Result<Response>> + 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;
    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 apply_migration<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        id: u64,
        name: String,
        migration: &'life1 Migration,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn exec<'life0, 'life1, 'async_trait>( &'life0 mut self, schema: &'life1 Arc<Schema>, plan: Operation, ) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a database operation

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,

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,

Returns a list of currently applied database migrations.

Source

fn apply_migration<'life0, 'life1, 'async_trait>( &'life0 mut self, id: u64, name: String, migration: &'life1 Migration, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Applies a migration to the database.

Implementors§