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§
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 PartialEq for ColumnOptionDef
impl PartialEq for ColumnOptionDef
impl Eq for ColumnOptionDef
impl StructuralPartialEq for ColumnOptionDef
Auto Trait Implementations§
impl Freeze for ColumnOptionDef
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<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
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more