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
Fields
is_primary: bool
{ 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
sourceimpl Clone for ColumnOption
impl Clone for ColumnOption
sourcefn clone(&self) -> ColumnOption
fn clone(&self) -> ColumnOption
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ColumnOption
impl Debug for ColumnOption
sourceimpl Display for ColumnOption
impl Display for ColumnOption
sourceimpl Hash for ColumnOption
impl Hash for ColumnOption
sourceimpl PartialEq<ColumnOption> for ColumnOption
impl PartialEq<ColumnOption> for ColumnOption
sourcefn eq(&self, other: &ColumnOption) -> bool
fn eq(&self, other: &ColumnOption) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ColumnOption) -> bool
fn ne(&self, other: &ColumnOption) -> bool
This method tests for !=
.
impl Eq for ColumnOption
impl StructuralEq for ColumnOption
impl StructuralPartialEq for ColumnOption
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more