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>::CteId: RefUnwindSafe,
<T as AstInfo>::DatabaseName: RefUnwindSafe,
<T as AstInfo>::RoleName: 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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