diesel::migration

Trait MigrationConnection

Source
pub trait MigrationConnection: Connection {
    // Required method
    fn setup(&mut self) -> QueryResult<usize>;
}
Expand description

A trait indicating that a connection could be used to manage migrations

Only custom backend implementations need to think about this trait

Required Methods§

Source

fn setup(&mut self) -> QueryResult<usize>

Setup the following table:

diesel::table! {
     __diesel_schema_migrations(version) {
         version -> Text,
         /// defaults to `CURRENT_TIMESTAMP`
         run_on -> Timestamp,
     }
}

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§

Source§

impl MigrationConnection for MysqlConnection

Available on crate feature mysql only.
Source§

impl MigrationConnection for PgConnection

Available on crate feature postgres only.
Source§

impl MigrationConnection for SqliteConnection

Available on crate feature sqlite only.
Source§

impl<M> MigrationConnection for PooledConnection<M>

Available on crate feature r2d2 only.