Enum sqlparser::ast::ColumnOption
source · pub enum ColumnOption {
Null,
NotNull,
Default(Expr),
Unique {
is_primary: bool,
},
ForeignKey {
foreign_table: ObjectName,
referred_columns: Vec<Ident>,
on_delete: Option<ReferentialAction>,
on_update: Option<ReferentialAction>,
},
Check(Expr),
DialectSpecific(Vec<Token>),
CharacterSet(ObjectName),
Comment(String),
}
Expand description
ColumnOption
s are modifiers that follow a column definition in a CREATE TABLE
statement.
Variants§
Null
NULL
NotNull
NOT NULL
Default(Expr)
DEFAULT <restricted-expr>
Unique
{ PRIMARY KEY | UNIQUE }
ForeignKey
Fields
§
foreign_table: ObjectName
§
on_delete: Option<ReferentialAction>
§
on_update: Option<ReferentialAction>
A referential integrity constraint ([FOREIGN KEY REFERENCES <foreign_table> (<referred_columns>) { [ON DELETE <referential_action>] [ON UPDATE <referential_action>] | [ON UPDATE <referential_action>] [ON DELETE <referential_action>] }
).
Check(Expr)
CHECK (<expr>)
DialectSpecific(Vec<Token>)
Dialect-specific options, such as:
- MySQL’s
AUTO_INCREMENT
or SQLite’sAUTOINCREMENT
- …
CharacterSet(ObjectName)
Comment(String)
Trait Implementations§
source§impl Clone for ColumnOption
impl Clone for ColumnOption
source§fn clone(&self) -> ColumnOption
fn clone(&self) -> ColumnOption
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ColumnOption
impl Debug for ColumnOption
source§impl Display for ColumnOption
impl Display for ColumnOption
source§impl Hash for ColumnOption
impl Hash for ColumnOption
source§impl Ord for ColumnOption
impl Ord for ColumnOption
source§fn cmp(&self, other: &ColumnOption) -> Ordering
fn cmp(&self, other: &ColumnOption) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<ColumnOption> for ColumnOption
impl PartialEq<ColumnOption> for ColumnOption
source§fn eq(&self, other: &ColumnOption) -> bool
fn eq(&self, other: &ColumnOption) -> bool
source§impl PartialOrd<ColumnOption> for ColumnOption
impl PartialOrd<ColumnOption> for ColumnOption
source§fn partial_cmp(&self, other: &ColumnOption) -> Option<Ordering>
fn partial_cmp(&self, other: &ColumnOption) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more