pub enum ColumnType {
}Expand description
Database column types
Variants§
Boolean
Boolean type
SmallInteger
Small integer (i16)
Integer
Integer (i32)
BigInteger
Big integer (i64)
Float
Single precision float (f32)
Double
Double precision float (f64)
Decimal
Decimal with precision and scale
String(Option<u32>)
Variable-length string with optional max length
Text
Unlimited text
Binary
Binary data
Date
Date (no time)
Time
Time (no date)
DateTime
DateTime without timezone
TimestampTz
DateTime with timezone
Uuid
UUID
Json
JSON
JsonB
JSONB (PostgreSQL)
Implementations§
Source§impl ColumnType
impl ColumnType
Sourcepub fn from_rust_type(type_str: &str) -> Self
pub fn from_rust_type(type_str: &str) -> Self
Infer column type from Rust type string
Sourcepub fn is_option_type(type_str: &str) -> bool
pub fn is_option_type(type_str: &str) -> bool
Check if this type is nullable by default (Option types)
Trait Implementations§
Source§impl Clone for ColumnType
impl Clone for ColumnType
Source§fn clone(&self) -> ColumnType
fn clone(&self) -> ColumnType
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 ColumnType
impl Debug for ColumnType
Source§impl<'de> Deserialize<'de> for ColumnType
impl<'de> Deserialize<'de> for ColumnType
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 PartialEq for ColumnType
impl PartialEq for ColumnType
Source§impl Serialize for ColumnType
impl Serialize for ColumnType
impl Eq for ColumnType
impl StructuralPartialEq for ColumnType
Auto Trait Implementations§
impl Freeze for ColumnType
impl RefUnwindSafe for ColumnType
impl Send for ColumnType
impl Sync for ColumnType
impl Unpin for ColumnType
impl UnwindSafe for ColumnType
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