Skip to main content

SchemaManagement

Trait SchemaManagement 

Source
pub trait SchemaManagement: Executor {
    // Required methods
    fn all_elements(
        &mut self,
        buffer: (&mut String, &mut Vector<Identifier>),
    ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>;
    fn clear(
        &mut self,
        buffer: (&mut String, &mut Vector<Identifier>),
    ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>;
    fn create_wtx_tables(
        &mut self,
    ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>;
    fn delete_migrations<S>(
        &mut self,
        buffer_cmd: &mut String,
        mg: &UserMigrationGroup<S>,
        uid: Uid,
    ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
       where S: Lease<str>;
    fn insert_migrations<'migration, DBS, I, S>(
        &mut self,
        buffer_cmd: &mut String,
        mg: &UserMigrationGroup<S>,
        migrations: I,
    ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
       where DBS: Lease<[DatabaseTy]> + 'migration,
             I: Clone + Iterator<Item = &'migration UserMigration<DBS, S>>,
             S: Lease<str> + 'migration;
    fn migrations<S>(
        &mut self,
        buffer_cmd: &mut String,
        mg: &UserMigrationGroup<S>,
        results: &mut Vector<DbMigration>,
    ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
       where S: Lease<str>;
    fn table_names(
        &mut self,
        buffer_cmd: &mut String,
        results: &mut Vector<Identifier>,
        schema: &str,
    ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>;
}
Available on crate features database and schema-manager only.
Expand description

Contains methods responsible to manage database migrations.

Required Methods§

Source

fn all_elements( &mut self, buffer: (&mut String, &mut Vector<Identifier>), ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>

Retrieves all inserted elements.

Source

fn clear( &mut self, buffer: (&mut String, &mut Vector<Identifier>), ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>

Cleans all database resources.

Source

fn create_wtx_tables( &mut self, ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>

Initial tables meant for initialization.

Source

fn delete_migrations<S>( &mut self, buffer_cmd: &mut String, mg: &UserMigrationGroup<S>, uid: Uid, ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
where S: Lease<str>,

Removes every migration of a given group mg`` that is greater than uid`.

Source

fn insert_migrations<'migration, DBS, I, S>( &mut self, buffer_cmd: &mut String, mg: &UserMigrationGroup<S>, migrations: I, ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
where DBS: Lease<[DatabaseTy]> + 'migration, I: Clone + Iterator<Item = &'migration UserMigration<DBS, S>>, S: Lease<str> + 'migration,

Inserts a new set of migrations,

Source

fn migrations<S>( &mut self, buffer_cmd: &mut String, mg: &UserMigrationGroup<S>, results: &mut Vector<DbMigration>, ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
where S: Lease<str>,

Retrieves all migrations of the given mg group in ascending order.

Source

fn table_names( &mut self, buffer_cmd: &mut String, results: &mut Vector<Identifier>, schema: &str, ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>

Retrieves all tables contained in a schema. If the implementation does not supports schemas, the parameter is ignored.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SchemaManagement for ()

Source§

async fn all_elements( &mut self, _: (&mut String, &mut Vector<Identifier>), ) -> Result<()>

Source§

async fn clear( &mut self, _: (&mut String, &mut Vector<Identifier>), ) -> Result<()>

Source§

async fn create_wtx_tables(&mut self) -> Result<()>

Source§

async fn delete_migrations<S>( &mut self, _: &mut String, _: &UserMigrationGroup<S>, _: Uid, ) -> Result<()>
where S: Lease<str>,

Source§

async fn insert_migrations<'migration, DBS, I, S>( &mut self, _: &mut String, _: &UserMigrationGroup<S>, _: I, ) -> Result<()>
where DBS: Lease<[DatabaseTy]> + 'migration, I: Clone + Iterator<Item = &'migration UserMigration<DBS, S>>, S: Lease<str> + 'migration,

Source§

async fn migrations<S>( &mut self, _: &mut String, _: &UserMigrationGroup<S>, _: &mut Vector<DbMigration>, ) -> Result<()>
where S: Lease<str>,

Source§

async fn table_names( &mut self, _: &mut String, _: &mut Vector<Identifier>, _: &str, ) -> Result<()>

Source§

impl<T> SchemaManagement for &mut T

Source§

async fn all_elements( &mut self, buffer: (&mut String, &mut Vector<Identifier>), ) -> Result<(), <Self::Database as DEController>::Error>

Source§

async fn clear( &mut self, buffer: (&mut String, &mut Vector<Identifier>), ) -> Result<(), <Self::Database as DEController>::Error>

Source§

async fn create_wtx_tables( &mut self, ) -> Result<(), <Self::Database as DEController>::Error>

Source§

async fn delete_migrations<S>( &mut self, buffer_cmd: &mut String, mg: &UserMigrationGroup<S>, uid: Uid, ) -> Result<(), <Self::Database as DEController>::Error>
where S: Lease<str>,

Source§

async fn insert_migrations<'migration, DBS, I, S>( &mut self, buffer_cmd: &mut String, mg: &UserMigrationGroup<S>, migrations: I, ) -> Result<(), <Self::Database as DEController>::Error>
where DBS: Lease<[DatabaseTy]> + 'migration, I: Clone + Iterator<Item = &'migration UserMigration<DBS, S>>, S: Lease<str> + 'migration,

Source§

async fn migrations<S>( &mut self, buffer_cmd: &mut String, mg: &UserMigrationGroup<S>, results: &mut Vector<DbMigration>, ) -> Result<(), <Self::Database as DEController>::Error>
where S: Lease<str>,

Source§

async fn table_names( &mut self, buffer_cmd: &mut String, results: &mut Vector<Identifier>, schema: &str, ) -> Result<(), <Self::Database as DEController>::Error>

Implementors§

Source§

impl<E, EB, STREAM> SchemaManagement for MysqlExecutor<E, EB, STREAM>
where E: From<Error>, EB: LeaseMut<ExecutorBuffer>, STREAM: Stream,

Available on crate feature mysql only.
Source§

impl<E, EB, STREAM> SchemaManagement for PostgresExecutor<E, EB, STREAM>
where E: From<Error>, EB: LeaseMut<ExecutorBuffer>, STREAM: Stream,

Available on crate feature postgres only.