pub struct TableDef {
pub name: TableName,
pub comment: Option<String>,
pub columns: Vec<ColumnDef>,
pub is_view: bool,
pub table_key: Vec<TableKey>,
}
Fields§
§name: TableName
§comment: Option<String>
comment of this table
columns: Vec<ColumnDef>
columns of this table
is_view: bool
views can also be generated
table_key: Vec<TableKey>
Implementations§
Source§impl TableDef
impl TableDef
pub fn complete_name(&self) -> String
pub fn safe_name(&self) -> String
pub fn safe_complete_name(&self) -> String
pub fn get_primary_column_names(&self) -> Vec<&ColumnName>
pub fn get_non_primary_columns(&self) -> Vec<&ColumnDef>
pub fn get_primary_columns(&self) -> Vec<&ColumnDef>
pub fn is_primary_column(&self, column: &ColumnDef) -> bool
pub fn get_primary_column_types(&self) -> Vec<&SqlType>
Sourcepub fn get_foreign_keys(&self) -> Vec<&ForeignKey>
pub fn get_foreign_keys(&self) -> Vec<&ForeignKey>
return the foreignkyes of this table
Sourcepub fn get_foreign_tables(&self) -> Vec<&TableName>
pub fn get_foreign_tables(&self) -> Vec<&TableName>
return the table names which is foreign to this table
pub fn get_foreign_key_to_table( &self, table_name: &TableName, ) -> Option<&ForeignKey>
Sourcepub fn get_local_foreign_columns_pair_to_table(
&self,
table_name: &TableName,
) -> Vec<(&ColumnName, &ColumnName)>
pub fn get_local_foreign_columns_pair_to_table( &self, table_name: &TableName, ) -> Vec<(&ColumnName, &ColumnName)>
get the (local_columns, foreign_columns) to the table
pub fn get_foreign_column_types_to_table( &self, table_name: &TableName, ) -> Vec<&SqlType>
pub fn get_foreign_column_names_to_table( &self, table_name: &TableName, ) -> Vec<&ColumnName>
Sourcepub fn get_foreign_column_names(&self) -> Vec<&ColumnName>
pub fn get_foreign_column_names(&self) -> Vec<&ColumnName>
get the column names of this table
Sourcepub fn get_referred_columns_to_table(
&self,
table_name: &TableName,
) -> Option<&Vec<ColumnName>>
pub fn get_referred_columns_to_table( &self, table_name: &TableName, ) -> Option<&Vec<ColumnName>>
return the local columns of this table that is referred by the argument table name
Sourcepub fn get_column(&self, column_name: &ColumnName) -> Option<&ColumnDef>
pub fn get_column(&self, column_name: &ColumnName) -> Option<&ColumnDef>
find the column which matches this column_name
Trait Implementations§
impl StructuralPartialEq for TableDef
Auto Trait Implementations§
impl Freeze for TableDef
impl RefUnwindSafe for TableDef
impl Send for TableDef
impl Sync for TableDef
impl Unpin for TableDef
impl UnwindSafe for TableDef
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