pub struct MigratedSchema { /* private fields */ }Expand description
What the migrations so far leave in the database: columns with their types, checks and indexes.
Implementations§
Source§impl Schema
impl Schema
pub fn read(&mut self, migration: &Lexed)
Sourcepub fn check_literals(
&self,
table: &str,
column: &str,
) -> Option<Vec<Vec<&str>>>
pub fn check_literals( &self, table: &str, column: &str, ) -> Option<Vec<Vec<&str>>>
The literals of each CHECK on the column, one list per CHECK, since only a single CHECK listing every value admits them all.
pub fn knows_table(&self, table: &str) -> bool
pub fn has_column(&self, table: &str, column: &str) -> bool
pub fn columns(&self, table: &str) -> Vec<&str>
pub fn is_unique(&self, table: &str, column: &str) -> bool
pub fn is_unique_over(&self, table: &str, columns: &[&str]) -> bool
Sourcepub fn has_type(
&self,
table: &str,
column: &str,
sql_type: &str,
) -> Option<bool>
pub fn has_type( &self, table: &str, column: &str, sql_type: &str, ) -> Option<bool>
Under any of Postgres’s names for the type: int8 is a bigint, varchar(20) a text.
pub fn is_nullable(&self, table: &str, column: &str) -> Option<bool>
Sourcepub fn is_indexed(&self, table: &str, column: &str) -> bool
pub fn is_indexed(&self, table: &str, column: &str) -> bool
An index leading with the column serves a lookup by it.
pub fn has_index(&self, name: &str) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Forget for Schema
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