pub enum TvpColumnType {
Show 17 variants
Bit,
TinyInt,
SmallInt,
Int,
BigInt,
Real,
Float,
Decimal {
precision: u8,
scale: u8,
},
NVarChar {
max_length: u16,
},
VarChar {
max_length: u16,
},
VarBinary {
max_length: u16,
},
UniqueIdentifier,
Date,
Time {
scale: u8,
},
DateTime2 {
scale: u8,
},
DateTimeOffset {
scale: u8,
},
Xml,
}Expand description
Column type identifier for TVP columns.
This enum maps Rust/SQL types to their TDS type identifiers for encoding within TVP column metadata.
Variants§
Bit
BIT type (boolean).
TinyInt
TINYINT type (u8).
SmallInt
SMALLINT type (i16).
Int
INT type (i32).
BigInt
BIGINT type (i64).
Real
REAL type (f32).
Float
FLOAT type (f64).
Decimal
DECIMAL/NUMERIC type with precision and scale.
NVarChar
NVARCHAR type with max length in characters.
VarChar
VARCHAR type with max length in bytes.
VarBinary
VARBINARY type with max length.
UniqueIdentifier
UNIQUEIDENTIFIER type (UUID).
Date
DATE type.
Time
TIME type with scale.
DateTime2
DATETIME2 type with scale.
DateTimeOffset
DATETIMEOFFSET type with scale.
Xml
XML type.
Implementations§
Source§impl TvpColumnType
impl TvpColumnType
Sourcepub fn from_sql_type(sql_type: &str) -> Option<Self>
pub fn from_sql_type(sql_type: &str) -> Option<Self>
Infer the TVP column type from an SQL type name string.
This parses SQL type declarations like “INT”, “NVARCHAR(100)”, “DECIMAL(18,2)”.
Sourcepub const fn max_length(&self) -> Option<u16>
pub const fn max_length(&self) -> Option<u16>
Get the max length field for this column type.
Trait Implementations§
Source§impl Clone for TvpColumnType
impl Clone for TvpColumnType
Source§fn clone(&self) -> TvpColumnType
fn clone(&self) -> TvpColumnType
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 TvpColumnType
impl Debug for TvpColumnType
Source§impl Hash for TvpColumnType
impl Hash for TvpColumnType
Source§impl PartialEq for TvpColumnType
impl PartialEq for TvpColumnType
impl Copy for TvpColumnType
impl Eq for TvpColumnType
impl StructuralPartialEq for TvpColumnType
Auto Trait Implementations§
impl Freeze for TvpColumnType
impl RefUnwindSafe for TvpColumnType
impl Send for TvpColumnType
impl Sync for TvpColumnType
impl Unpin for TvpColumnType
impl UnwindSafe for TvpColumnType
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