pub struct Schema {
pub statements: Vec<String>,
/* private fields */
}Fields§
§statements: Vec<String>Implementations§
Source§impl Schema
impl Schema
pub fn new() -> Schema
pub fn for_driver(driver: Driver) -> Schema
pub fn driver(&self) -> Driver
Sourcepub fn table<F>(&mut self, table: &str, build: F)
pub fn table<F>(&mut self, table: &str, build: F)
Alter an existing table. The closure can call add_* / drop_column /
rename_column / index / foreign-key methods on Table.
Mirrors Schema::table('users', function (Blueprint $table) { ... }).
pub fn drop(&mut self, table: &str)
pub fn drop_if_exists(&mut self, table: &str)
Sourcepub fn rename(&mut self, from: &str, to: &str)
pub fn rename(&mut self, from: &str, to: &str)
Rename a table. Mirrors Schema::rename('old', 'new').
Sourcepub fn has_table(&mut self, _table: &str)
pub fn has_table(&mut self, _table: &str)
Check if a table exists (executed at apply-time as a SELECT). v0.2 will return bool.
pub fn raw(&mut self, sql: impl Into<String>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
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