Enum gluesql::core::sqlparser::ast::ColumnOption
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),
OnUpdate(Expr),
Generated {
generated_as: GeneratedAs,
sequence_options: Option<Vec<SequenceOptions>>,
generation_expr: Option<Expr>,
},
}
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)
OnUpdate(Expr)
Generated
Generated
s are modifiers that follow a column definition in a CREATE TABLE
statement.
Trait Implementations§
§impl Clone for ColumnOption
impl Clone for ColumnOption
§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 more§impl Debug for ColumnOption
impl Debug for ColumnOption
§impl<'de> Deserialize<'de> for ColumnOption
impl<'de> Deserialize<'de> for ColumnOption
§fn deserialize<__D>(
__deserializer: __D
) -> Result<ColumnOption, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<ColumnOption, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for ColumnOption
impl Display for ColumnOption
§impl Hash for ColumnOption
impl Hash for ColumnOption
§impl Ord for ColumnOption
impl Ord for ColumnOption
§impl PartialEq for ColumnOption
impl PartialEq for ColumnOption
§fn 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 ==
.§impl PartialOrd for ColumnOption
impl PartialOrd for ColumnOption
§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§impl Serialize for ColumnOption
impl Serialize for ColumnOption
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
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§
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.