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 type)
compress: boolWhether to compress this column’s data (e.g., brotli for text)
enum_variants: Vec<String>For Enum type: list of valid variants
decimal_precision: u8For Decimal type: number of decimal places (default 4)
element_type: Option<DataType>For Array type: 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 default value
Sourcepub fn with_vector_dim(self, dim: u32) -> Self
pub fn with_vector_dim(self, dim: u32) -> Self
Set 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 metadata
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 (for Enum type columns)
Sourcepub fn with_precision(self, precision: u8) -> Self
pub fn with_precision(self, precision: u8) -> Self
Set decimal precision (for Decimal type columns)
Sourcepub fn with_element_type(self, dt: DataType) -> Self
pub fn with_element_type(self, dt: DataType) -> Self
Set element type (for Array type columns)
Trait Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request