pub struct ColumnDef {
pub column_ref: ColumnRef,
pub column_type: BTreeMap<&'static str, &'static str>,
pub value: Value,
pub nullable: bool,
pub default: DefaultValueType,
pub primary_key: PrimaryKeyType,
pub unique: bool,
pub references: Option<ColumnRef>,
pub on_delete: Option<Action>,
pub on_update: Option<Action>,
pub passive: bool,
pub comment: &'static str,
}Expand description
Column specification.
Fields§
§column_ref: ColumnRefColumn identity.
column_type: BTreeMap<&'static str, &'static str>Explicit SQL type override (empty means infer from value).
value: ValueValue describing column type and parameters.
nullable: boolNullability flag.
default: DefaultValueTypeDefault value (expression rendered by SqlWriter).
primary_key: PrimaryKeyTypePrimary key participation.
unique: boolUnique constraint (single column only, composite handled in the TableDef).
references: Option<ColumnRef>Foreign key target column.
on_delete: Option<Action>Action for deletes.
on_update: Option<Action>Action for updates.
passive: boolPassive columns are skipped when generating INSERT value lists (DEFAULT used).
comment: &'static strOptional human-readable comment.
Implementations§
Trait Implementations§
Source§impl Expression for ColumnDef
impl Expression for ColumnDef
Source§impl OpPrecedence for ColumnDef
impl OpPrecedence for ColumnDef
Source§fn precedence(&self, _writer: &dyn SqlWriter) -> i32
fn precedence(&self, _writer: &dyn SqlWriter) -> i32
Lower numbers bind weaker, writers parenthesize when child precedence <= operator precedence.
Auto Trait Implementations§
impl Freeze for ColumnDef
impl !RefUnwindSafe for ColumnDef
impl Send for ColumnDef
impl Sync for ColumnDef
impl Unpin for ColumnDef
impl !UnwindSafe for ColumnDef
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