pub struct ForgeSchemaColumn {Show 13 fields
pub name: String,
pub data_type: String,
pub length: Option<u32>,
pub precision: Option<u32>,
pub scale: Option<u32>,
pub is_nullable: bool,
pub is_primary_key: bool,
pub is_unsigned: bool,
pub auto_increment: bool,
pub default: Option<String>,
pub comment: Option<String>,
pub on_update: Option<String>,
pub enum_values: Option<Vec<String>>,
}Expand description
Represents a table column with all its properties.
§Examples
use fluxforge::core::ForgeSchemaColumn;
let mut col = ForgeSchemaColumn::new("id", "integer");
col.is_primary_key = true;
col.auto_increment = true;Fields§
§name: StringColumn name
data_type: StringData type (mapped according to configuration)
length: Option<u32>Length for character types (VARCHAR, CHAR)
precision: Option<u32>Precision for numeric types (DECIMAL, NUMERIC)
scale: Option<u32>Scale for numeric types (DECIMAL, NUMERIC)
is_nullable: boolWhether the column allows NULL values
is_primary_key: boolWhether this column is part of the primary key
is_unsigned: boolWhether this is an unsigned integer (MySQL)
auto_increment: boolWhether this column auto-increments
default: Option<String>Default value expression
comment: Option<String>Column comment
on_update: Option<String>ON UPDATE expression (e.g., CURRENT_TIMESTAMP)
enum_values: Option<Vec<String>>Enum/Set values for ENUM and SET types
Implementations§
Trait Implementations§
Source§impl Clone for ForgeSchemaColumn
impl Clone for ForgeSchemaColumn
Source§fn clone(&self) -> ForgeSchemaColumn
fn clone(&self) -> ForgeSchemaColumn
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ForgeSchemaColumn
impl Debug for ForgeSchemaColumn
Source§impl Default for ForgeSchemaColumn
impl Default for ForgeSchemaColumn
Source§fn default() -> ForgeSchemaColumn
fn default() -> ForgeSchemaColumn
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ForgeSchemaColumn
impl<'de> Deserialize<'de> for ForgeSchemaColumn
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ForgeSchemaColumn
impl RefUnwindSafe for ForgeSchemaColumn
impl Send for ForgeSchemaColumn
impl Sync for ForgeSchemaColumn
impl Unpin for ForgeSchemaColumn
impl UnsafeUnpin for ForgeSchemaColumn
impl UnwindSafe for ForgeSchemaColumn
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 more