pub struct ColumnDef {Show 13 fields
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 clustering_key: bool,
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 types.
value: ValueType descriptor.
nullable: boolIs nullable.
default: DefaultValueTypeDefault expression.
primary_key: PrimaryKeyTypePrimary key role.
clustering_key: boolClustering key (relevant for ScyllaDB / Cassandra).
unique: boolSingle-column unique constraint.
references: Option<ColumnRef>Foreign key target.
on_delete: Option<Action>On delete action.
on_update: Option<Action>On update action.
passive: boolExclude from INSERTs.
comment: &'static strComment.
Implementations§
Trait Implementations§
Source§impl Expression for ColumnDef
impl Expression for ColumnDef
Source§fn write_query(
&self,
writer: &dyn SqlWriter,
context: &mut Context,
out: &mut DynQuery,
)
fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, )
Render the expression into SQL.
Source§fn accept_visitor(
&self,
matcher: &mut dyn ExpressionVisitor,
writer: &dyn SqlWriter,
context: &mut Context,
out: &mut DynQuery,
) -> bool
fn accept_visitor( &self, matcher: &mut dyn ExpressionVisitor, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, ) -> bool
Match the expression.
Source§fn as_identifier(&self, context: &mut Context) -> String
fn as_identifier(&self, context: &mut Context) -> String
Convert expression to an identifier string.
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 UnsafeUnpin 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