Skip to main content

Migration

Struct Migration 

Source
pub struct Migration { /* private fields */ }
Expand description

마이그레이션 스텝 — 세 소스(SQL 파일/인라인 SQL/코드)의 공통 표현 (명세 §8.2)

Implementations§

Source§

impl Migration

Source

pub fn sql(from: u32, to: u32, sql: impl Into<String>) -> Self

인라인 SQL 스텝 — Migration::sql(1, 2, "ALTER TABLE …") (명세 §8.2)

Source

pub fn sql_batch(from: u32, to: u32, sql: impl Into<String>) -> Self

여러 문장 SQL 스텝 — execute_batch와 동일(별칭, 의도 명시용)

Source

pub fn code( from: u32, to: u32, f: impl Fn(&Tx<'_>) -> Result<()> + Send + Sync + 'static, ) -> Self

코드 스텝

Source

pub fn from_step(step: impl MigrationStep) -> Self

trait 구현체 래핑 (명세 §8.3)

Source

pub fn from_version(&self) -> u32

시작 버전 (명세 [C-3] 확정 이름)

Source

pub fn to_version(&self) -> u32

도착 버전

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.