pub struct ColumnDef {
pub name: String,
pub data_type: DataType,
pub nullable: bool,
pub default: Option<Vec<u8>>,
pub vector_dim: Option<u32>,
pub compress: bool,
pub enum_variants: Vec<String>,
pub decimal_precision: u8,
pub element_type: Option<DataType>,
pub metadata: HashMap<String, String>,
}Expand description
Column definition.
Fields§
§name: StringColumn name.
data_type: DataTypeData type.
nullable: boolWhether NULL values are allowed.
default: Option<Vec<u8>>Default value (serialized).
vector_dim: Option<u32>Vector dimension (for vector columns).
compress: boolWhether to compress this column’s data.
enum_variants: Vec<String>Valid enum variants.
decimal_precision: u8Number of decimal places.
element_type: Option<DataType>Array element data type.
metadata: HashMap<String, String>Additional column metadata.
Implementations§
Source§impl ColumnDef
impl ColumnDef
Sourcepub fn new(name: impl Into<String>, data_type: DataType) -> Self
pub fn new(name: impl Into<String>, data_type: DataType) -> Self
Create a new column definition.
Sourcepub fn with_default(self, default: Vec<u8>) -> Self
pub fn with_default(self, default: Vec<u8>) -> Self
Set the serialized default value.
Sourcepub fn with_vector_dim(self, dimension: u32) -> Self
pub fn with_vector_dim(self, dimension: u32) -> Self
Set the vector dimension.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a metadata entry.
Sourcepub fn compressed(self) -> Self
pub fn compressed(self) -> Self
Enable per-column compression.
Sourcepub fn with_variants(self, variants: Vec<String>) -> Self
pub fn with_variants(self, variants: Vec<String>) -> Self
Set enum variants.
Sourcepub fn with_precision(self, precision: u8) -> Self
pub fn with_precision(self, precision: u8) -> Self
Set decimal precision.
Sourcepub fn with_element_type(self, data_type: DataType) -> Self
pub fn with_element_type(self, data_type: DataType) -> Self
Set the array element type.
Trait Implementations§
impl Eq for ColumnDef
impl StructuralPartialEq for ColumnDef
Auto Trait Implementations§
impl Forget for ColumnDef
impl Freeze for ColumnDefwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<(String, String)>: Freeze,
impl Move for ColumnDef
impl RefUnwindSafe for ColumnDef
impl Send for ColumnDef
impl Sync for ColumnDef
impl Unpin for ColumnDef
impl UnsafeUnpin for ColumnDefwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more