Skip to main content

SchemaColumn

Struct SchemaColumn 

Source
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: usize

Unique identifier for the column (0-based index)

§name: String

Column name

§name_lower: String

Pre-computed lowercase column name for case-insensitive lookups

§data_type: DataType

Data type of the column

§nullable: bool

Whether the column can contain NULL values

§primary_key: bool

Whether this column is part of the primary key

§auto_increment: bool

Whether 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: u16

Number of dimensions for VECTOR columns (0 = not a vector column)

Implementations§

Source§

impl SchemaColumn

Source

pub fn new( id: usize, name: impl Into<String>, data_type: DataType, nullable: bool, primary_key: bool, ) -> Self

Create a new column definition

Source

pub fn with_vector_dimensions(self, dims: u16) -> Self

Set vector dimensions (for VECTOR columns)

Source

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

Source

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

Source

pub fn simple(id: usize, name: impl Into<String>, data_type: DataType) -> Self

Create a simple non-nullable, non-primary-key column

Source

pub fn nullable(id: usize, name: impl Into<String>, data_type: DataType) -> Self

Create a nullable column

Source

pub fn primary_key( id: usize, name: impl Into<String>, data_type: DataType, ) -> Self

Create a primary key column

Trait Implementations§

Source§

impl Clone for SchemaColumn

Source§

fn clone(&self) -> SchemaColumn

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SchemaColumn

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SchemaColumn

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SchemaColumn

Source§

fn eq(&self, other: &SchemaColumn) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for SchemaColumn

Source§

impl StructuralPartialEq for SchemaColumn

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CompactArcDrop for T

Source§

unsafe fn drop_and_dealloc(ptr: *mut u8)

Drop the contained data and deallocate the header+data allocation. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V