#[non_exhaustive]pub struct ColumnDef {
pub name: String,
pub column_type: ColumnType,
pub nullable: bool,
pub default: Option<String>,
pub primary_key: bool,
pub modifiers: Vec<ColumnModifier>,
pub generated_expr: Option<String>,
pub generated_deps: Vec<String>,
pub added_at_version: u32,
}Expand description
A single column definition in a strict document or columnar schema.
#[non_exhaustive] — new fields may be added (e.g. column-level
compression hints, foreign-key metadata).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: String§column_type: ColumnType§nullable: bool§default: Option<String>§primary_key: bool§modifiers: Vec<ColumnModifier>Column-level modifiers (TIME_KEY, SPATIAL_INDEX, etc.).
generated_expr: Option<String>GENERATED ALWAYS AS expression (serialized SqlExpr JSON). When set, this column is computed at write time, not supplied by the user.
generated_deps: Vec<String>Column names this generated column depends on.
added_at_version: u32Schema version at which this column was added. Original columns have
version 1 (the default). Columns added via ALTER ADD COLUMN record
the schema version after the bump so the reader can build a physical
sub-schema for tuples written under older versions.
Implementations§
Source§impl ColumnDef
impl ColumnDef
pub fn required(name: impl Into<String>, column_type: ColumnType) -> Self
pub fn nullable(name: impl Into<String>, column_type: ColumnType) -> Self
pub fn with_primary_key(self) -> Self
Sourcepub fn is_time_key(&self) -> bool
pub fn is_time_key(&self) -> bool
Check if this column has the TIME_KEY modifier.
Sourcepub fn is_spatial_index(&self) -> bool
pub fn is_spatial_index(&self) -> bool
Check if this column has the SPATIAL_INDEX modifier.
pub fn with_default(self, expr: impl Into<String>) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ColumnDef
impl<'de> Deserialize<'de> for ColumnDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for ColumnDef
impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for ColumnDef
Source§impl ToMessagePack for ColumnDef
impl ToMessagePack for ColumnDef
impl Eq for ColumnDef
impl StructuralPartialEq for ColumnDef
Auto Trait Implementations§
impl Freeze for ColumnDef
impl RefUnwindSafe for ColumnDef
impl Send for ColumnDef
impl Sync for ColumnDef
impl Unpin for ColumnDef
impl UnsafeUnpin for ColumnDef
impl UnwindSafe for ColumnDef
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.