pub struct PropertyBuilder<'a, T, V = ()> { /* private fields */ }Implementations§
Source§impl<'a, T, V> PropertyBuilder<'a, T, V>
impl<'a, T, V> PropertyBuilder<'a, T, V>
pub fn is_required(self) -> Self
Sourcepub fn is_optional(self) -> Self
pub fn is_optional(self) -> Self
Marks the column nullable (opposite of Self::is_required).
Sourcepub fn has_column_type(self, sql_type: &str) -> Self
pub fn has_column_type(self, sql_type: &str) -> Self
Overrides the database column type verbatim for every dialect
(HasColumnType), e.g. "JSON", "MEDIUMTEXT", "DECIMAL(12,2)".
Sourcepub fn has_precision(self, precision: u32, scale: u32) -> Self
pub fn has_precision(self, precision: u32, scale: u32) -> Self
Sets decimal/numeric precision and scale (HasPrecision(p, s)).
For temporal types the precision is emitted as the fractional-seconds
precision (DATETIME(p) / TIMESTAMP(p)).
Sourcepub fn is_fixed_length(self) -> Self
pub fn is_fixed_length(self) -> Self
Uses a fixed-length string type (CHAR(n)), n = max_length.
Sourcepub fn has_collation(self, name: &str) -> Self
pub fn has_collation(self, name: &str) -> Self
Sets a column-level collation (HasCollation), emitted as
COLLATE <name> (include quotes yourself for quoted names).
Sourcepub fn has_comment(self, text: &str) -> Self
pub fn has_comment(self, text: &str) -> Self
Sets a column comment (HasComment).
Sourcepub fn has_computed_column_sql(self, sql: &str) -> Self
pub fn has_computed_column_sql(self, sql: &str) -> Self
Declares a generated/computed column (HasComputedColumnSql).
sql is a raw SQL expression (e.g. unit_price * quantity). Computed
columns are excluded from INSERT/UPDATE. Use Self::is_stored to
persist the value (required by PostgreSQL).
Sourcepub fn is_stored(self) -> Self
pub fn is_stored(self) -> Self
Persists a computed column (STORED); no-op for non-computed columns.
Sourcepub fn is_concurrency_token(self) -> Self
pub fn is_concurrency_token(self) -> Self
Marks the column as an optimistic concurrency token.
pub fn has_max_length(self, n: usize) -> Self
pub fn has_column_name(self, name: &'static str) -> Self
pub fn is_unique(self) -> Self
pub fn has_index(self) -> Self
Sourcepub fn has_default(self, sql: &str) -> Self
pub fn has_default(self, sql: &str) -> Self
Sets a raw SQL DEFAULT expression, e.g. .has_default("1") or
.has_default("CURRENT_TIMESTAMP"). String literals must include their
quotes ("'pending'").