pub struct Column {
pub name: String,
pub col_type: ColumnType,
pub source_type: String,
pub ordinal: ColumnId,
pub is_primary_key: bool,
pub is_nullable: bool,
pub is_unique: bool,
pub default_sql: Option<String>,
pub is_generated: bool,
pub is_identity: bool,
pub collation: Option<String>,
}Expand description
Column definition within a table
Fields§
§name: StringColumn name
col_type: ColumnTypeColumn type
source_type: StringRaw SQL type as written in the DDL (e.g. "VARCHAR(255)")
ordinal: ColumnIdPosition in table (0-indexed)
is_primary_key: boolWhether this column is part of the primary key
is_nullable: boolWhether this column allows NULL values
is_unique: boolWhether this column has a single-column UNIQUE constraint
default_sql: Option<String>Raw DEFAULT expression, if any (e.g. "'active'", "(NOW())")
is_generated: boolWhether this is a generated/computed column (GENERATED ALWAYS AS (...))
is_identity: boolWhether this column is an auto-generated identity/auto-increment column
collation: Option<String>Explicit column collation, if declared (COLLATE ...)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnsafeUnpin for Column
impl UnwindSafe for Column
Blanket Implementations§
impl<T> Allocation for T
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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