pub struct ColumnDef {
pub name: String,
pub ty: ColumnTypeName,
pub nullable: bool,
pub default: Option<Expr>,
pub auto_increment: bool,
pub is_primary_key: bool,
pub is_unique: bool,
pub check: Option<Expr>,
}Fields§
§name: String§ty: ColumnTypeName§nullable: bool§default: Option<Expr>DEFAULT <expr> literal supplied at CREATE TABLE. Engine
evaluates this once (with an empty row) and caches the resulting
Value on the column schema.
auto_increment: boolMySQL-style AUTO_INCREMENT — the engine maintains a counter
per such column and fills the slot when INSERT leaves it
unbound (omitted from a column-list INSERT or explicitly NULL).
is_primary_key: boolv7.9.13 — inline PRIMARY KEY column constraint. mailrs
migration follow-up F1. Implies NOT NULL. Engine creates
an implicit BTree index named <table>_pkey over this
column at CREATE TABLE time, satisfying the parent-side
index requirement for any FOREIGN KEY pointing at it.
is_unique: boolv7.13.0 — inline UNIQUE column constraint
(mailrs round-5 G2). The CREATE TABLE handler folds this
into a single-column TableConstraint::Unique so the
engine path stays uniform with table-level UNIQUE.
check: Option<Expr>v7.13.0 — inline CHECK (<expr>) column constraint
(mailrs round-5 G3). Stored alongside the column so the
CREATE TABLE handler can fold these into table-level
CHECK constraints. Multiple inline CHECKs on the same
column are concatenated with AND at the table level.