Struct ergol_core::Table
source · pub struct Table {
pub name: String,
pub columns: Vec<Column>,
}
Expand description
The struct that holds the information to create, drop or migrate a table.
Fields§
§name: String
The name of the table.
columns: Vec<Column>
The columns of the table.
Implementations§
source§impl Table
impl Table
sourcepub fn create_table(&self) -> String
pub fn create_table(&self) -> String
Returns the create table query for the table.
sourcepub fn drop_table(&self) -> String
pub fn drop_table(&self) -> String
Returns the drop table query for the table.
sourcepub fn current_migration() -> Table
pub fn current_migration() -> Table
Creates the current migration table.
sourcepub fn dependencies(&self) -> Vec<String>
pub fn dependencies(&self) -> Vec<String>
Returns the names of the tables on which self depends.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Table
impl<'de> Deserialize<'de> for Table
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Table> for Table
impl PartialEq<Table> for Table
impl Eq for Table
impl StructuralEq for Table
impl StructuralPartialEq for Table
Auto Trait Implementations§
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
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