pub struct Schema<'c> { /* private fields */ }Expand description
The handle a migration uses to change the schema. Renders sea-query
statements for the running backend, with a raw-SQL escape hatch.
Implementations§
Source§impl Schema<'_>
impl Schema<'_>
pub fn backend(&self) -> DbBackend
Sourcepub async fn exec<S: SchemaStatementBuilder>(
&mut self,
stmt: S,
) -> CoreResult<()>
pub async fn exec<S: SchemaStatementBuilder>( &mut self, stmt: S, ) -> CoreResult<()>
Runs a sea-query schema statement (Table::create/alter/drop,
Index::create, …). Takes the statement by value and renders it to SQL
before awaiting, so the (non-Send) statement is not held across the
await point.
Sourcepub async fn raw(&mut self, sql: &str) -> CoreResult<()>
pub async fn raw(&mut self, sql: &str) -> CoreResult<()>
Runs raw SQL, for anything the builder does not express. Portability is the caller’s responsibility.
Auto Trait Implementations§
impl<'c> !RefUnwindSafe for Schema<'c>
impl<'c> !Sync for Schema<'c>
impl<'c> !UnwindSafe for Schema<'c>
impl<'c> Freeze for Schema<'c>
impl<'c> Send for Schema<'c>
impl<'c> Unpin for Schema<'c>
impl<'c> UnsafeUnpin for Schema<'c>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more