Struct sqlparser::ast::ColumnOptionDef
source · [−]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: ColumnOptionTrait Implementations
sourceimpl Clone for ColumnOptionDef
impl Clone for ColumnOptionDef
sourcefn clone(&self) -> ColumnOptionDef
fn clone(&self) -> ColumnOptionDef
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 ColumnOptionDef
impl Debug for ColumnOptionDef
sourceimpl Display for ColumnOptionDef
impl Display for ColumnOptionDef
sourceimpl Hash for ColumnOptionDef
impl Hash for ColumnOptionDef
sourceimpl PartialEq<ColumnOptionDef> for ColumnOptionDef
impl PartialEq<ColumnOptionDef> for ColumnOptionDef
sourcefn eq(&self, other: &ColumnOptionDef) -> bool
fn eq(&self, other: &ColumnOptionDef) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ColumnOptionDef) -> bool
fn ne(&self, other: &ColumnOptionDef) -> bool
This method tests for !=.
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
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