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§
Sourcefn all_elements(
&mut self,
buffer: (&mut String, &mut Vector<Identifier>),
) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
fn all_elements( &mut self, buffer: (&mut String, &mut Vector<Identifier>), ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
Retrieves all inserted elements.
Sourcefn clear(
&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>>
Cleans all database resources.
Sourcefn create_wtx_tables(
&mut self,
) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
fn create_wtx_tables( &mut self, ) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
Initial tables meant for initialization.
Sourcefn delete_migrations<S>(
&mut self,
buffer_cmd: &mut String,
mg: &UserMigrationGroup<S>,
uid: Uid,
) -> 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>>
Removes every migration of a given group mg`` that is greater than uid`.
Sourcefn 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 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,
Sourcefn migrations<S>(
&mut self,
buffer_cmd: &mut String,
mg: &UserMigrationGroup<S>,
results: &mut Vector<DbMigration>,
) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
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>>
Retrieves all migrations of the given mg group in ascending order.
Sourcefn table_names(
&mut self,
buffer_cmd: &mut String,
results: &mut Vector<Identifier>,
schema: &str,
) -> impl Future<Output = Result<(), <Self::Database as DEController>::Error>>
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 ()
impl SchemaManagement for ()
async fn all_elements( &mut self, _: (&mut String, &mut Vector<Identifier>), ) -> Result<()>
async fn clear( &mut self, _: (&mut String, &mut Vector<Identifier>), ) -> Result<()>
async fn create_wtx_tables(&mut self) -> Result<()>
async fn delete_migrations<S>( &mut self, _: &mut String, _: &UserMigrationGroup<S>, _: Uid, ) -> Result<()>
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,
async fn migrations<S>( &mut self, _: &mut String, _: &UserMigrationGroup<S>, _: &mut Vector<DbMigration>, ) -> Result<()>
async fn table_names( &mut self, _: &mut String, _: &mut Vector<Identifier>, _: &str, ) -> Result<()>
Source§impl<T> SchemaManagement for &mut Twhere
T: SchemaManagement,
impl<T> SchemaManagement for &mut Twhere
T: SchemaManagement,
async fn all_elements( &mut self, buffer: (&mut String, &mut Vector<Identifier>), ) -> Result<(), <Self::Database as DEController>::Error>
async fn clear( &mut self, buffer: (&mut String, &mut Vector<Identifier>), ) -> Result<(), <Self::Database as DEController>::Error>
async fn create_wtx_tables( &mut self, ) -> Result<(), <Self::Database as DEController>::Error>
async fn delete_migrations<S>( &mut self, buffer_cmd: &mut String, mg: &UserMigrationGroup<S>, uid: Uid, ) -> Result<(), <Self::Database as DEController>::Error>
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,
async fn migrations<S>( &mut self, buffer_cmd: &mut String, mg: &UserMigrationGroup<S>, results: &mut Vector<DbMigration>, ) -> Result<(), <Self::Database as DEController>::Error>
async fn table_names( &mut self, buffer_cmd: &mut String, results: &mut Vector<Identifier>, schema: &str, ) -> Result<(), <Self::Database as DEController>::Error>
Implementors§
impl<E, EB, STREAM> SchemaManagement for MysqlExecutor<E, EB, STREAM>
Available on crate feature
mysql only.impl<E, EB, STREAM> SchemaManagement for PostgresExecutor<E, EB, STREAM>
Available on crate feature
postgres only.