pub struct Column {
pub name: String,
pub col_type: String,
pub is_nullable: bool,
pub is_primary_key: bool,
pub is_auto_increment: bool,
pub default_value: Option<ColumnDefault>,
}Fields§
§name: String§col_type: String§is_nullable: bool§is_primary_key: bool§is_auto_increment: bool§default_value: Option<ColumnDefault>Implementations§
Source§impl Column
impl Column
Sourcepub fn new(name: &str, col_type: &str) -> Self
pub fn new(name: &str, col_type: &str) -> Self
Creates a new column, validating name against SQL identifier rules.
§Panics
Panics if name fails identifier validation. Column names are always
developer-supplied compile-time literals — an invalid name is a bug,
not a runtime condition.
pub fn not_null(&mut self) -> &mut Self
pub fn nullable(&mut self) -> &mut Self
Sourcepub fn default(&mut self, val: ColumnDefault) -> &mut Self
pub fn default(&mut self, val: ColumnDefault) -> &mut Self
Sets a safe DEFAULT value using the ColumnDefault enum.
The old &str overload has been removed to prevent DDL injection
through unescaped DEFAULT clauses.
pub fn primary(&mut self) -> &mut Self
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
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