pub struct Column {
pub name: Option<String>,
pub ty_str: String,
pub ty_params: Vec<Box<Expr>>,
pub default: Option<Box<Expr>>,
pub notnull_conflict_clause: Option<ResolveType>,
/* private fields */
}Fields§
§name: Option<String>§ty_str: String§ty_params: Vec<Box<Expr>>§default: Option<Box<Expr>>§notnull_conflict_clause: Option<ResolveType>ON CONFLICT clause for NOT NULL constraint on this column.
Implementations§
Source§impl Column
impl Column
pub fn affinity(&self) -> Affinity
Sourcepub fn set_base_affinity(&mut self, affinity: Affinity)
pub fn set_base_affinity(&mut self, affinity: Affinity)
Set the base type affinity override for a custom type column. This ensures affinity rules use the custom type’s BASE type rather than applying SQLite name-based rules to the type name.
pub fn affinity_with_strict(&self, is_strict: bool) -> Affinity
pub fn new_default_text( name: Option<String>, ty_str: String, default: Option<Box<Expr>>, ) -> Self
pub fn new_default_integer( name: Option<String>, ty_str: String, default: Option<Box<Expr>>, ) -> Self
pub fn new( name: Option<String>, ty_str: String, default: Option<Box<Expr>>, generated: Option<Box<Expr>>, ty: Type, col: Option<CollationSeq>, coldef: ColDef, ) -> Self
pub const fn ty(&self) -> Type
pub const fn set_ty(&mut self, ty: Type)
pub const fn collation_opt(&self) -> Option<CollationSeq>
pub const fn collation(&self) -> CollationSeq
pub const fn has_explicit_collation(&self) -> bool
pub const fn set_collation(&mut self, c: Option<CollationSeq>)
pub fn primary_key(&self) -> bool
pub const fn is_rowid_alias(&self) -> bool
pub const fn notnull(&self) -> bool
pub const fn explicit_notnull(&self) -> bool
pub const fn unique(&self) -> bool
Sourcepub fn ensure_not_generated(
&self,
verb_phrase: &str,
col_name: &str,
) -> Result<()>
pub fn ensure_not_generated( &self, verb_phrase: &str, col_name: &str, ) -> Result<()>
Returns an error if this column is a generated column.
verb_phrase should describe the operation, e.g. “INSERT into” or “UPDATE”.
pub fn generated_type(&self) -> &GeneratedType
pub const fn is_generated(&self) -> bool
pub const fn is_virtual_generated(&self) -> bool
pub fn generated_expr(&self) -> Option<&Expr>
pub fn generated_expr_mut(&mut self) -> Option<&mut Expr>
pub fn set_generated_original_sql(&mut self, new_sql: String)
pub const fn set_primary_key(&mut self, v: bool)
pub const fn set_rowid_alias(&mut self, v: bool)
pub const fn set_notnull(&mut self, v: bool)
pub const fn set_unique(&mut self, v: bool)
pub const fn is_array(&self) -> bool
Sourcepub const fn array_dimensions(&self) -> u32
pub const fn array_dimensions(&self) -> u32
Number of array dimensions (0 = scalar, 1 = [], 2 = [][], etc.)
pub fn set_array_dimensions(&mut self, dims: u32)
Trait Implementations§
Source§impl TryFrom<&ColumnDefinition> for Column
impl TryFrom<&ColumnDefinition> for Column
Source§type Error = LimboError
type Error = LimboError
The type returned in the event of a conversion error.
Source§fn try_from(value: &ColumnDefinition) -> Result<Self>
fn try_from(value: &ColumnDefinition) -> Result<Self>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnsafeUnpin for Column
impl UnwindSafe for Column
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more