#[non_exhaustive]pub enum SqlValue {
Show 18 variants
Null,
Bool(bool),
TinyInt(u8),
SmallInt(i16),
Int(i32),
BigInt(i64),
Float(f32),
Double(f64),
String(String),
Binary(Bytes),
Decimal(Decimal),
Uuid(Uuid),
Date(NaiveDate),
Time(NaiveTime),
DateTime(NaiveDateTime),
DateTimeOffset(DateTime<FixedOffset>),
Xml(String),
Tvp(Box<TvpData>),
}Expand description
A SQL value that can represent any SQL Server data type.
This enum provides a type-safe way to handle SQL values that may be of various types, including NULL.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Null
NULL value.
Bool(bool)
Boolean value (BIT).
TinyInt(u8)
8-bit unsigned integer (TINYINT).
SmallInt(i16)
16-bit signed integer (SMALLINT).
Int(i32)
32-bit signed integer (INT).
BigInt(i64)
64-bit signed integer (BIGINT).
Float(f32)
32-bit floating point (REAL).
Double(f64)
64-bit floating point (FLOAT).
String(String)
String value (CHAR, VARCHAR, NCHAR, NVARCHAR, TEXT, NTEXT).
Binary(Bytes)
Binary value (BINARY, VARBINARY, IMAGE).
Decimal(Decimal)
Decimal value (DECIMAL, NUMERIC, MONEY, SMALLMONEY).
Uuid(Uuid)
UUID value (UNIQUEIDENTIFIER).
Date(NaiveDate)
Date value (DATE).
Time(NaiveTime)
Time value (TIME).
DateTime(NaiveDateTime)
DateTime value (DATETIME, DATETIME2, SMALLDATETIME).
DateTimeOffset(DateTime<FixedOffset>)
DateTimeOffset value (DATETIMEOFFSET).
Xml(String)
XML value (XML type).
Tvp(Box<TvpData>)
Table-Valued Parameter (TVP).
TVPs allow passing collections of structured data to SQL Server stored procedures. Boxed due to large size.
Implementations§
Trait Implementations§
Source§impl From<NaiveDateTime> for SqlValue
Available on crate feature chrono only.
impl From<NaiveDateTime> for SqlValue
chrono only.