[][src]Struct oapth::Migration

pub struct Migration { /* fields omitted */ }

A migration that is intended to be inserted into a database

Implementations

impl Migration[src]

pub fn new<IN, ISD, ISU>(
    version: i32,
    name: IN,
    sql_up: ISU,
    sql_down: ISD
) -> Self where
    IN: Into<String>,
    ISD: Into<String>,
    ISU: Into<String>, 
[src]

Creates a new instance from all necessary input parameters.

pub fn checksum(&self) -> &str[src]

Checksum

Example

use oapth::doc_tests::migration;
assert_eq!(migration().checksum(), "10126747658053090972")

pub fn name(&self) -> &str[src]

Name

Example

use oapth::doc_tests::migration;
assert_eq!(migration().name(), "create_author")

pub fn sql_down(&self) -> &str[src]

Raw SQL for rollbacks

Example

use oapth::doc_tests::migration;
assert_eq!(migration().sql_down(), "DROP TABLE author");

pub fn sql_up(&self) -> &str[src]

Raw SQL for migrations

Example

use oapth::doc_tests::migration;
let mg = assert_eq!(
  migration().sql_up(),
  "CREATE TABLE author (id INT NOT NULL PRIMARY KEY, name VARCHAR(50) NOT NULL)"
);

pub fn version(&self) -> i32[src]

Migration version

Example

use oapth::doc_tests::migration;
assert_eq!(migration().version(), 1)

Trait Implementations

impl Debug for Migration[src]

impl Eq for Migration[src]

impl Ord for Migration[src]

impl PartialEq<Migration> for Migration[src]

impl PartialOrd<Migration> for Migration[src]

impl StructuralEq for Migration[src]

impl StructuralPartialEq for Migration[src]

Auto Trait Implementations

impl Send for Migration

impl Sync for Migration

impl Unpin for Migration

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.