Struct gluesql::core::sqlparser::ast::ColumnOptionDef
pub struct ColumnOptionDef {
pub name: Option<Ident>,
pub option: ColumnOption,
}
Expand description
An optionally-named ColumnOption
: [ CONSTRAINT <name> ] <column-option>
.
Note that implementations are substantially more permissive than the ANSI
specification on what order column options can be presented in, and whether
they are allowed to be named. The specification distinguishes between
constraints (NOT NULL, UNIQUE, PRIMARY KEY, and CHECK), which can be named
and can appear in any order, and other options (DEFAULT, GENERATED), which
cannot be named and must appear in a fixed order. PostgreSQL
, however,
allows preceding any option with CONSTRAINT <name>
, even those that are
not really constraints, like NULL and DEFAULT. MSSQL is less permissive,
allowing DEFAULT, UNIQUE, PRIMARY KEY and CHECK to be named, but not NULL or
NOT NULL constraints (the last of which is in violation of the spec).
For maximum flexibility, we don’t distinguish between constraint and non-constraint options, lumping them all together under the umbrella of “column options,” and we allow any column option to be named.
Fields§
§name: Option<Ident>
§option: ColumnOption
Trait Implementations§
§impl Clone for ColumnOptionDef
impl Clone for ColumnOptionDef
§fn clone(&self) -> ColumnOptionDef
fn clone(&self) -> ColumnOptionDef
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ColumnOptionDef
impl Debug for ColumnOptionDef
§impl<'de> Deserialize<'de> for ColumnOptionDef
impl<'de> Deserialize<'de> for ColumnOptionDef
§fn deserialize<__D>(
__deserializer: __D
) -> Result<ColumnOptionDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<ColumnOptionDef, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl Display for ColumnOptionDef
impl Display for ColumnOptionDef
§impl Hash for ColumnOptionDef
impl Hash for ColumnOptionDef
§impl Ord for ColumnOptionDef
impl Ord for ColumnOptionDef
§impl PartialEq for ColumnOptionDef
impl PartialEq for ColumnOptionDef
§fn eq(&self, other: &ColumnOptionDef) -> bool
fn eq(&self, other: &ColumnOptionDef) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for ColumnOptionDef
impl PartialOrd for ColumnOptionDef
§fn partial_cmp(&self, other: &ColumnOptionDef) -> Option<Ordering>
fn partial_cmp(&self, other: &ColumnOptionDef) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more§impl Serialize for ColumnOptionDef
impl Serialize for ColumnOptionDef
§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,
impl Eq for ColumnOptionDef
impl StructuralEq for ColumnOptionDef
impl StructuralPartialEq for ColumnOptionDef
Auto Trait Implementations§
impl RefUnwindSafe for ColumnOptionDef
impl Send for ColumnOptionDef
impl Sync for ColumnOptionDef
impl Unpin for ColumnOptionDef
impl UnwindSafe for ColumnOptionDef
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
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
key
and return true
if they are equal.