tern_core::migration

Trait QueryRepository

Source
pub trait QueryRepository {
    // Required methods
    fn create_history_if_not_exists_query(history_table: &str) -> Query;
    fn drop_history_query(history_table: &str) -> Query;
    fn insert_into_history_query(
        history_table: &str,
        applied: &AppliedMigration,
    ) -> Query;
    fn select_star_from_history_query(history_table: &str) -> Query;
    fn upsert_history_query(
        history_table: &str,
        applied: &AppliedMigration,
    ) -> Query;
}
Expand description

A type that has a library of “administrative” queries that are needed during a migration run.

Required Methods§

Source

fn create_history_if_not_exists_query(history_table: &str) -> Query

The query that creates the schema history table or does nothing if it already exists.

Source

fn drop_history_query(history_table: &str) -> Query

The query that drops the history table if requested.

Source

fn insert_into_history_query( history_table: &str, applied: &AppliedMigration, ) -> Query

The query to update the schema history table with an applied migration.

Source

fn select_star_from_history_query(history_table: &str) -> Query

The query to return all rows from the schema history table.

Source

fn upsert_history_query( history_table: &str, applied: &AppliedMigration, ) -> Query

Query to insert or update a record in the history table.

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.

Implementors§