Struct Schema
pub struct Schema {
pub database: String,
pub schema: String,
pub version: Version,
pub tables: Vec<TableDef>,
pub views: Vec<ViewDef>,
}Fields§
§database: String§schema: String§version: Version§tables: Vec<TableDef>§views: Vec<ViewDef>Implementations§
§impl Schema
impl Schema
pub fn alphabetical_sort(&mut self)
pub fn alphabetical_sort(&mut self)
Sort tables by name.
pub fn topological_sort(&mut self)
pub fn topological_sort(&mut self)
Sort tables by topological order, considering foreign key dependencies.
§impl Schema
impl Schema
pub fn write_tables(&self) -> Vec<TableCreateStatement>
pub fn write_indices(&self) -> Vec<IndexCreateStatement>
pub fn write_indices(&self) -> Vec<IndexCreateStatement>
There are some indices cannot be created in the same statement with the table
pub fn write_comments(&self) -> Vec<CommentStatement>
Trait Implementations§
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin 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