Enum models_parser::ast::ColumnOption [−][src]
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>),
}
Expand description
ColumnOption
s are modifiers that follow a column definition in a CREATE TABLE
statement.
Variants
NULL
NOT NULL
Default(Expr)
DEFAULT <restricted-expr>
Tuple Fields of Default
0: Expr
{ PRIMARY KEY | UNIQUE }
Fields of Unique
is_primary: bool
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>] }
).
Fields of ForeignKey
foreign_table: ObjectName
referred_columns: Vec<Ident>
on_delete: Option<ReferentialAction>
on_update: Option<ReferentialAction>
Check(Expr)
CHECK (<expr>)
Tuple Fields of Check
0: Expr
Dialect-specific options, such as:
- MySQL’s
AUTO_INCREMENT
or SQLite’sAUTOINCREMENT
- …
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ColumnOption
impl Send for ColumnOption
impl Sync for ColumnOption
impl Unpin for ColumnOption
impl UnwindSafe for ColumnOption
Blanket Implementations
Mutably borrows from an owned value. Read more