pub struct TableSchema {
pub name: String,
pub columns: Vec<ColumnSchema>,
}
Expand description
Table schema
Fields§
§name: String
Name
columns: Vec<ColumnSchema>
Columns
Implementations§
Source§impl TableSchema
impl TableSchema
Sourcepub fn with_column(self, column: ColumnSchema) -> Self
pub fn with_column(self, column: ColumnSchema) -> Self
Adds a column
Sourcepub fn add_column(&mut self, id: &str, ty: Type, primary: bool) -> &mut Self
pub fn add_column(&mut self, id: &str, ty: Type, primary: bool) -> &mut Self
Adds a column
Sourcepub fn get_column_by_id(&self, id: &str) -> Option<&ColumnSchema>
pub fn get_column_by_id(&self, id: &str) -> Option<&ColumnSchema>
Returns a column by ID
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TableSchema
impl RefUnwindSafe for TableSchema
impl Send for TableSchema
impl Sync for TableSchema
impl Unpin for TableSchema
impl UnwindSafe for TableSchema
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