pub trait Executor{
type Queries: QueryRepository;
// Required methods
fn apply_tx(
&mut self,
query: &Query,
) -> impl Future<Output = TernResult<()>> + Send;
fn apply_no_tx(
&mut self,
query: &Query,
) -> impl Future<Output = TernResult<()>> + Send;
fn create_history_if_not_exists(
&mut self,
history_table: &str,
) -> impl Future<Output = TernResult<()>> + Send;
fn drop_history(
&mut self,
history_table: &str,
) -> impl Future<Output = TernResult<()>> + Send;
fn get_all_applied(
&mut self,
history_table: &str,
) -> impl Future<Output = TernResult<Vec<AppliedMigration>>> + Send;
fn insert_applied_migration(
&mut self,
history_table: &str,
applied: &AppliedMigration,
) -> impl Future<Output = TernResult<()>> + Send;
fn upsert_applied_migration(
&mut self,
history_table: &str,
applied: &AppliedMigration,
) -> impl Future<Output = TernResult<()>> + Send;
}
Expand description
The “executor” type for the database backend ultimately responsible for issuing migration and schema history queries.
Required Associated Types§
Sourcetype Queries: QueryRepository
type Queries: QueryRepository
The type of value that can produce queries for the history table of this migration set.
Required Methods§
Sourcefn apply_tx(
&mut self,
query: &Query,
) -> impl Future<Output = TernResult<()>> + Send
fn apply_tx( &mut self, query: &Query, ) -> impl Future<Output = TernResult<()>> + Send
Apply the Query
for the migration in a transaction.
Sourcefn apply_no_tx(
&mut self,
query: &Query,
) -> impl Future<Output = TernResult<()>> + Send
fn apply_no_tx( &mut self, query: &Query, ) -> impl Future<Output = TernResult<()>> + Send
Apply the Query
for the migration not in a transaction.
Sourcefn create_history_if_not_exists(
&mut self,
history_table: &str,
) -> impl Future<Output = TernResult<()>> + Send
fn create_history_if_not_exists( &mut self, history_table: &str, ) -> impl Future<Output = TernResult<()>> + Send
CREATE IF NOT EXISTS
the history table.
Sourcefn drop_history(
&mut self,
history_table: &str,
) -> impl Future<Output = TernResult<()>> + Send
fn drop_history( &mut self, history_table: &str, ) -> impl Future<Output = TernResult<()>> + Send
DROP
the history table.
Sourcefn get_all_applied(
&mut self,
history_table: &str,
) -> impl Future<Output = TernResult<Vec<AppliedMigration>>> + Send
fn get_all_applied( &mut self, history_table: &str, ) -> impl Future<Output = TernResult<Vec<AppliedMigration>>> + Send
Get the complete history of applied migrations.
Sourcefn insert_applied_migration(
&mut self,
history_table: &str,
applied: &AppliedMigration,
) -> impl Future<Output = TernResult<()>> + Send
fn insert_applied_migration( &mut self, history_table: &str, applied: &AppliedMigration, ) -> impl Future<Output = TernResult<()>> + Send
Insert an applied migration into the history table.
Sourcefn upsert_applied_migration(
&mut self,
history_table: &str,
applied: &AppliedMigration,
) -> impl Future<Output = TernResult<()>> + Send
fn upsert_applied_migration( &mut self, history_table: &str, applied: &AppliedMigration, ) -> impl Future<Output = TernResult<()>> + Send
Update or insert an applied migration.
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.