pub struct ColumnDef {Show 23 fields
pub name: String,
pub ty: ColumnType,
pub object_id: Option<[u8; 16]>,
pub missing_value: Option<Value>,
pub primary_key: bool,
pub not_null: bool,
pub not_null_explicit: bool,
pub not_null_name: Option<String>,
pub not_null_validated: bool,
pub not_null_no_inherit: bool,
pub not_null_is_local: bool,
pub auto_increment: Option<AutoIncrement>,
pub unique: bool,
pub default: Option<Expr>,
pub generated: Option<GeneratedColumn>,
pub check: Option<Expr>,
pub check_name: Option<String>,
pub check_enforced: bool,
pub check_validated: bool,
pub check_no_inherit: bool,
pub check_is_local: bool,
pub check_object_id: Option<[u8; 16]>,
pub references: Option<ForeignKeyRef>,
}Fields§
§name: String§ty: ColumnType§object_id: Option<[u8; 16]>Durable identity of this catalog column. Logical names can change while a fixed transaction snapshot continues to address the same column.
missing_value: Option<Value>Value exposed for physical rows captured before this column was added. This is the catalog equivalent of PostgreSQL’s attmissingval.
primary_key: bool§not_null: bool§not_null_explicit: boolWhether NOT NULL was declared as its own constraint instead of being
implied by PRIMARY KEY or an auto-incrementing identity.
not_null_name: Option<String>Durable PostgreSQL 18 NOT NULL constraint name. Parsing leaves an
unnamed declaration as None; table registration assigns and persists
PostgreSQL’s generated name before the constraint becomes visible.
not_null_validated: boolWhether the named NOT NULL constraint has been validated against
every pre-existing row. NOT VALID still enforces future writes.
not_null_no_inherit: boolDurable NO INHERIT state for PostgreSQL 18 named NOT NULL
constraints.
not_null_is_local: boolWhether this relation declares its NOT NULL constraint locally, independently from inherited parent constraints. Older serialized definitions retain their original local catalog projection.
auto_increment: Option<AutoIncrement>Sequence provenance for SERIAL / BIGSERIAL and identity columns. The custom decoder accepts the legacy boolean representation written by releases that merged both SQL features into one table counter.
unique: boolUNIQUE column constraint – the engine rejects an INSERT
whose value for this column already exists in another row.
default: Option<Expr>DEFAULT <expr>. Evaluated at INSERT time when the column is
not present in the row tuple. Persisted in catalog metadata so
reopened engines keep the same INSERT semantics.
generated: Option<GeneratedColumn>PostgreSQL 18 generated-column definition. Stored values are refreshed
on every row write; virtual values are evaluated from the physical row
only when a logical row is read.
check: Option<Expr>CHECK (<expr>) column-level constraint. Evaluated at INSERT
(and UPDATE-replace) time against the row being written.
check_name: Option<String>§check_enforced: bool§check_validated: bool§check_no_inherit: bool§check_is_local: boolWhether this relation declares its column CHECK locally, independently from inherited copies. Missing legacy origin retains the historical local projection.
check_object_id: Option<[u8; 16]>Durable identity of the column CHECK, preserved across constraint and relation renames.
references: Option<ForeignKeyRef>Column-level REFERENCES parent[(col)] foreign key. An omitted column is resolved to the referenced primary key before publication.
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>,
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> 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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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