pub struct ColumnSchema {
pub field_name: &'static str,
pub name: &'static str,
pub column_type: ColumnType,
pub nullable: bool,
pub primary_key: bool,
pub unique: bool,
pub default: Option<&'static str>,
pub check: Option<&'static str>,
pub choices: Option<Vec<&'static str>>,
pub references: Option<ForeignKey>,
pub auto_now_add: bool,
pub auto_now: bool,
}Expand description
Metadata for one table column.
Fields§
§field_name: &'static strRust field name used to identify this column in migration state.
name: &'static strPhysical column name used in SQL.
column_type: ColumnType§nullable: bool§primary_key: bool§unique: bool§default: Option<&'static str>§check: Option<&'static str>§choices: Option<Vec<&'static str>>§references: Option<ForeignKey>§auto_now_add: bool§auto_now: boolImplementations§
Source§impl ColumnSchema
impl ColumnSchema
pub fn new(name: &'static str, column_type: ColumnType, nullable: bool) -> Self
Sourcepub fn with_field_name(self, field_name: &'static str) -> Self
pub fn with_field_name(self, field_name: &'static str) -> Self
Associates a Rust field name with a physical SQL column name.
Trait Implementations§
Source§impl Clone for ColumnSchema
impl Clone for ColumnSchema
Source§impl Debug for ColumnSchema
impl Debug for ColumnSchema
impl Eq for ColumnSchema
Source§impl From<&ColumnSchema> for ColumnState
impl From<&ColumnSchema> for ColumnState
Source§fn from(column: &ColumnSchema) -> Self
fn from(column: &ColumnSchema) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ColumnSchema
impl PartialEq for ColumnSchema
impl StructuralPartialEq for ColumnSchema
Auto Trait Implementations§
impl Freeze for ColumnSchema
impl RefUnwindSafe for ColumnSchema
impl Send for ColumnSchema
impl Sync for ColumnSchema
impl Unpin for ColumnSchema
impl UnsafeUnpin for ColumnSchema
impl UnwindSafe for ColumnSchema
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