pub struct Generated {
pub expression: Cow<'static, str>,
pub gen_type: GeneratedType,
}Expand description
Generated column configuration (runtime)
Fields§
§expression: Cow<'static, str>SQL expression for generation
gen_type: GeneratedTypeGeneration type: stored or virtual
Implementations§
Source§impl Generated
impl Generated
Sourcepub fn to_sql(&self) -> String
pub fn to_sql(&self) -> String
Generate the GENERATED clause SQL
SQLite requires the generation expression to be parenthesized
(GENERATED ALWAYS AS (expr)), so the expression is wrapped in parens
unless it is already fully parenthesized (the table macros store
pre-parenthesized expressions; introspection stores bare expressions).
Trait Implementations§
impl Eq for Generated
impl StructuralPartialEq for Generated
Auto Trait Implementations§
impl Freeze for Generated
impl RefUnwindSafe for Generated
impl Send for Generated
impl Sync for Generated
impl Unpin for Generated
impl UnsafeUnpin for Generated
impl UnwindSafe for Generated
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