Struct mz_sql_parser::ast::defs::ddl::ColumnOptionDef
source · pub struct ColumnOptionDef<T: AstInfo> {
pub name: Option<Ident>,
pub option: ColumnOption<T>,
}
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<T>
Trait Implementations§
source§impl<T: AstInfo> AstDisplay for ColumnOptionDef<T>
impl<T: AstInfo> AstDisplay for ColumnOptionDef<T>
fn fmt<W: Write>(&self, f: &mut AstFormatter<W>)
fn to_ast_string(&self) -> String
fn to_ast_string_stable(&self) -> String
fn to_ast_string_redacted(&self) -> String
source§impl<T: Clone + AstInfo> Clone for ColumnOptionDef<T>
impl<T: Clone + AstInfo> Clone for ColumnOptionDef<T>
source§fn clone(&self) -> ColumnOptionDef<T>
fn clone(&self) -> ColumnOptionDef<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T: AstInfo> Display for ColumnOptionDef<T>
impl<T: AstInfo> Display for ColumnOptionDef<T>
source§impl<'ast, T: AstInfo> VisitMutNode<'ast, T> for ColumnOptionDef<T>
impl<'ast, T: AstInfo> VisitMutNode<'ast, T> for ColumnOptionDef<T>
source§impl<'ast, T: AstInfo> VisitNode<'ast, T> for ColumnOptionDef<T>
impl<'ast, T: AstInfo> VisitNode<'ast, T> for ColumnOptionDef<T>
impl<T: Eq + AstInfo> Eq for ColumnOptionDef<T>
impl<T: AstInfo> StructuralPartialEq for ColumnOptionDef<T>
Auto Trait Implementations§
impl<T> Freeze for ColumnOptionDef<T>
impl<T> RefUnwindSafe for ColumnOptionDef<T>where
<T as AstInfo>::DataType: RefUnwindSafe,
<T as AstInfo>::ItemName: RefUnwindSafe,
<T as AstInfo>::ClusterName: RefUnwindSafe,
<T as AstInfo>::SchemaName: RefUnwindSafe,
<T as AstInfo>::DatabaseName: RefUnwindSafe,
<T as AstInfo>::RoleName: RefUnwindSafe,
<T as AstInfo>::CteId: RefUnwindSafe,
impl<T> Send for ColumnOptionDef<T>
impl<T> Sync for ColumnOptionDef<T>
impl<T> Unpin for ColumnOptionDef<T>
impl<T> UnwindSafe for ColumnOptionDef<T>where
<T as AstInfo>::DataType: UnwindSafe + RefUnwindSafe,
<T as AstInfo>::ItemName: UnwindSafe + RefUnwindSafe,
<T as AstInfo>::ClusterName: UnwindSafe + RefUnwindSafe,
<T as AstInfo>::SchemaName: UnwindSafe + RefUnwindSafe,
<T as AstInfo>::CteId: UnwindSafe + RefUnwindSafe,
<T as AstInfo>::DatabaseName: UnwindSafe + RefUnwindSafe,
<T as AstInfo>::RoleName: UnwindSafe + RefUnwindSafe,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request