pub struct Column { /* private fields */ }
Expand description
A database column.
Implementations§
source§impl Column
impl Column
sourcepub fn build<S: Into<String>>(name: S) -> ColumnBuilder
pub fn build<S: Into<String>>(name: S) -> ColumnBuilder
Begins building a new column with the given name.
Examples
let column = msi::Column::build("Foo").nullable().int16();
assert_eq!(column.name(), "Foo");
assert!(column.is_nullable());
assert_eq!(column.coltype(), msi::ColumnType::Int16);
sourcepub fn coltype(&self) -> ColumnType
pub fn coltype(&self) -> ColumnType
Returns the type of data stored in the column.
sourcepub fn is_localizable(&self) -> bool
pub fn is_localizable(&self) -> bool
Returns true if values in this column can be localized.
sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Returns true if values in this column can be null.
sourcepub fn is_primary_key(&self) -> bool
pub fn is_primary_key(&self) -> bool
Returns true if this is primary key column.
sourcepub fn value_range(&self) -> Option<(i32, i32)>
pub fn value_range(&self) -> Option<(i32, i32)>
Returns the (min, max) integer value range for this column, if any.
sourcepub fn category(&self) -> Option<Category>
pub fn category(&self) -> Option<Category>
Returns the string value category for this column, if any.
sourcepub fn enum_values(&self) -> Option<&[String]>
pub fn enum_values(&self) -> Option<&[String]>
Returns the list of valid enum values for this column, if any.
sourcepub fn is_valid_value(&self, value: &Value) -> bool
pub fn is_valid_value(&self, value: &Value) -> bool
Returns true if the given value is valid for this column.