pub enum DefaultValue {
Bool(bool),
Integer(i64),
Float(f64),
String(String),
}Expand description
A value that can be a string, boolean, or number. This is used for default values where columns can use literal values directly.
Variants§
Implementations§
Source§impl DefaultValue
impl DefaultValue
Sourcepub fn to_sql(&self) -> String
pub fn to_sql(&self) -> String
Convert to SQL string representation Empty strings are converted to ‘’ (SQL empty string literal)
Sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Check if this is a string type (needs quoting for certain column types)
Sourcepub fn is_empty_string(&self) -> bool
pub fn is_empty_string(&self) -> bool
Check if this is an empty string
Trait Implementations§
Source§impl Clone for DefaultValue
impl Clone for DefaultValue
Source§fn clone(&self) -> DefaultValue
fn clone(&self) -> DefaultValue
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 DefaultValue
impl Debug for DefaultValue
Source§impl<'de> Deserialize<'de> for DefaultValue
impl<'de> Deserialize<'de> for DefaultValue
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
Source§impl From<&str> for DefaultValue
impl From<&str> for DefaultValue
Source§impl From<String> for DefaultValue
impl From<String> for DefaultValue
Source§impl From<bool> for DefaultValue
impl From<bool> for DefaultValue
Source§impl From<f64> for DefaultValue
impl From<f64> for DefaultValue
Source§impl From<i32> for DefaultValue
impl From<i32> for DefaultValue
Source§impl From<i64> for DefaultValue
impl From<i64> for DefaultValue
Source§impl JsonSchema for DefaultValue
impl JsonSchema for DefaultValue
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for DefaultValue
impl PartialEq for DefaultValue
Source§impl Serialize for DefaultValue
impl Serialize for DefaultValue
impl Eq for DefaultValue
impl StructuralPartialEq for DefaultValue
Auto Trait Implementations§
impl Freeze for DefaultValue
impl RefUnwindSafe for DefaultValue
impl Send for DefaultValue
impl Sync for DefaultValue
impl Unpin for DefaultValue
impl UnwindSafe for DefaultValue
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