Struct msi::ColumnBuilder
source · pub struct ColumnBuilder { /* private fields */ }
Expand description
A factory for configuring a new database column.
Implementations§
source§impl ColumnBuilder
impl ColumnBuilder
sourcepub fn localizable(self) -> ColumnBuilder
pub fn localizable(self) -> ColumnBuilder
Makes the column be localizable.
sourcepub fn nullable(self) -> ColumnBuilder
pub fn nullable(self) -> ColumnBuilder
Makes the column allow null values.
sourcepub fn primary_key(self) -> ColumnBuilder
pub fn primary_key(self) -> ColumnBuilder
Makes the column be a primary key column.
sourcepub fn range(self, min: i32, max: i32) -> ColumnBuilder
pub fn range(self, min: i32, max: i32) -> ColumnBuilder
Makes the column only permit values in the given range.
sourcepub fn foreign_key(self, table_name: &str, column_index: i32) -> ColumnBuilder
pub fn foreign_key(self, table_name: &str, column_index: i32) -> ColumnBuilder
Makes the column refer to a key column in another table.
sourcepub fn category(self, category: Category) -> ColumnBuilder
pub fn category(self, category: Category) -> ColumnBuilder
For string columns, makes the column use the specified data format.
sourcepub fn enum_values(self, values: &[&str]) -> ColumnBuilder
pub fn enum_values(self, values: &[&str]) -> ColumnBuilder
Makes the column only permit the given values.
sourcepub fn id_string(self, max_len: usize) -> Column
pub fn id_string(self, max_len: usize) -> Column
Builds a column that stores an identifier string. This is equivalent
to self.category(Category::Identifier).string(max_len)
.
sourcepub fn text_string(self, max_len: usize) -> Column
pub fn text_string(self, max_len: usize) -> Column
Builds a column that stores a text string. This is equivalent to
self.category(Category::Text).string(max_len)
.
sourcepub fn formatted_string(self, max_len: usize) -> Column
pub fn formatted_string(self, max_len: usize) -> Column
Builds a column that stores a formatted string. This is equivalent to
self.category(Category::Formatted).string(max_len)
.