pub struct SchemaColumn {
pub id: usize,
pub name: String,
pub name_lower: String,
pub data_type: DataType,
pub nullable: bool,
pub primary_key: bool,
pub auto_increment: bool,
pub default_expr: Option<String>,
pub default_value: Option<Value>,
pub check_expr: Option<String>,
pub vector_dimensions: u16,
}Expand description
A column definition in a table schema
Fields§
§id: usizeUnique identifier for the column (0-based index)
name: StringColumn name
name_lower: StringPre-computed lowercase column name for case-insensitive lookups
data_type: DataTypeData type of the column
nullable: boolWhether the column can contain NULL values
primary_key: boolWhether this column is part of the primary key
auto_increment: boolWhether this column auto-increments (generates sequential IDs for NULL values)
default_expr: Option<String>Default value expression as a string (to be parsed and evaluated during INSERT)
default_value: Option<Value>Pre-computed default value for schema evolution (used when adding column to existing rows)
check_expr: Option<String>CHECK constraint expression as a string (to be parsed and evaluated during INSERT)
vector_dimensions: u16Number of dimensions for VECTOR columns (0 = not a vector column)
Implementations§
Source§impl SchemaColumn
impl SchemaColumn
Sourcepub fn new(
id: usize,
name: impl Into<String>,
data_type: DataType,
nullable: bool,
primary_key: bool,
) -> Self
pub fn new( id: usize, name: impl Into<String>, data_type: DataType, nullable: bool, primary_key: bool, ) -> Self
Create a new column definition
Sourcepub fn with_vector_dimensions(self, dims: u16) -> Self
pub fn with_vector_dimensions(self, dims: u16) -> Self
Set vector dimensions (for VECTOR columns)
Sourcepub fn with_constraints(
id: usize,
name: impl Into<String>,
data_type: DataType,
nullable: bool,
primary_key: bool,
auto_increment: bool,
default_expr: Option<String>,
check_expr: Option<String>,
) -> Self
pub fn with_constraints( id: usize, name: impl Into<String>, data_type: DataType, nullable: bool, primary_key: bool, auto_increment: bool, default_expr: Option<String>, check_expr: Option<String>, ) -> Self
Create a new column definition with all options
Sourcepub fn with_default_value(
id: usize,
name: impl Into<String>,
data_type: DataType,
nullable: bool,
primary_key: bool,
auto_increment: bool,
default_expr: Option<String>,
default_value: Option<Value>,
check_expr: Option<String>,
) -> Self
pub fn with_default_value( id: usize, name: impl Into<String>, data_type: DataType, nullable: bool, primary_key: bool, auto_increment: bool, default_expr: Option<String>, default_value: Option<Value>, check_expr: Option<String>, ) -> Self
Create a new column definition with pre-computed default value
Sourcepub fn simple(id: usize, name: impl Into<String>, data_type: DataType) -> Self
pub fn simple(id: usize, name: impl Into<String>, data_type: DataType) -> Self
Create a simple non-nullable, non-primary-key column
Trait Implementations§
Source§impl Clone for SchemaColumn
impl Clone for SchemaColumn
Source§fn clone(&self) -> SchemaColumn
fn clone(&self) -> SchemaColumn
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SchemaColumn
impl Debug for SchemaColumn
Source§impl Display for SchemaColumn
impl Display for SchemaColumn
Source§impl PartialEq for SchemaColumn
impl PartialEq for SchemaColumn
impl Eq for SchemaColumn
impl StructuralPartialEq for SchemaColumn
Auto Trait Implementations§
impl Freeze for SchemaColumn
impl RefUnwindSafe for SchemaColumn
impl Send for SchemaColumn
impl Sync for SchemaColumn
impl Unpin for SchemaColumn
impl UnsafeUnpin for SchemaColumn
impl UnwindSafe for SchemaColumn
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§impl<T> CompactArcDrop for T
impl<T> CompactArcDrop for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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