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§
Source§impl AsNodeKey for ColumnOptionDef
impl AsNodeKey for ColumnOptionDef
fn as_node_key(&self) -> NodeKey<'_>
Source§impl Clone for ColumnOptionDef
impl Clone for ColumnOptionDef
Source§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 moreSource§impl Debug for ColumnOptionDef
impl Debug for ColumnOptionDef
Source§impl Display for ColumnOptionDef
impl Display for ColumnOptionDef
Source§impl Hash for ColumnOptionDef
impl Hash for ColumnOptionDef
Source§impl Ord for ColumnOptionDef
impl Ord for ColumnOptionDef
Source§fn cmp(&self, other: &ColumnOptionDef) -> Ordering
fn cmp(&self, other: &ColumnOptionDef) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ColumnOptionDef
impl PartialEq for ColumnOptionDef
Source§impl PartialOrd for ColumnOptionDef
impl PartialOrd for ColumnOptionDef
Source§impl Spanned for ColumnOptionDef
impl Spanned for ColumnOptionDef
Source§impl<'ast> Transformable<'ast> for ColumnOptionDef
impl<'ast> Transformable<'ast> for ColumnOptionDef
Source§impl Visitable for ColumnOptionDef
impl Visitable for ColumnOptionDef
Source§fn accept<'ast, V: Visitor<'ast>>(
&'ast self,
visitor: &mut V,
) -> ControlFlow<Break<V::Error>>
fn accept<'ast, V: Visitor<'ast>>( &'ast self, visitor: &mut V, ) -> ControlFlow<Break<V::Error>>
Visitor and traverses the AST starting at self invoking Visitor::enter and
Visitor::exit as nodes are entered and exiting respectively.Source§fn downcast_ref<Target: Visitable>(&self) -> Option<&Target>
fn downcast_ref<Target: Visitable>(&self) -> Option<&Target>
self as &Target.Source§fn downcast_mut<Target: Visitable>(&mut self) -> Option<&mut Target>
fn downcast_mut<Target: Visitable>(&mut self) -> Option<&mut Target>
self as &mut Target.