pub struct TypeInfo {
pub type_id: u8,
pub max_length: Option<u16>,
pub precision: Option<u8>,
pub scale: Option<u8>,
pub collation: Option<[u8; 5]>,
pub tvp_type_name: Option<String>,
}Expand description
TDS type information for RPC parameters.
Fields§
§type_id: u8Type ID.
max_length: Option<u16>Maximum length for variable-length types.
precision: Option<u8>Precision for numeric types.
scale: Option<u8>Scale for numeric types.
collation: Option<[u8; 5]>Collation for string types.
tvp_type_name: Option<String>TVP type name (e.g., “dbo.IntIdList”) for Table-Valued Parameters.
Implementations§
Source§impl TypeInfo
impl TypeInfo
Sourcepub fn nvarchar_max() -> Self
pub fn nvarchar_max() -> Self
Create type info for NVARCHAR(MAX).
Sourcepub fn varchar_with_collation(max_len: u16, collation: [u8; 5]) -> Self
pub fn varchar_with_collation(max_len: u16, collation: [u8; 5]) -> Self
Create type info for VARCHAR with max length and explicit collation.
Sourcepub fn varchar_max() -> Self
pub fn varchar_max() -> Self
Create type info for VARCHAR(MAX).
Sourcepub fn varchar_max_with_collation(collation: [u8; 5]) -> Self
pub fn varchar_max_with_collation(collation: [u8; 5]) -> Self
Create type info for VARCHAR(MAX) with explicit collation.
Sourcepub fn varbinary_max() -> Self
pub fn varbinary_max() -> Self
Create type info for VARBINARY(MAX).
Sourcepub fn char(len: u16) -> Self
pub fn char(len: u16) -> Self
Create type info for fixed-length CHAR (BIGCHARTYPE / 0xAF), length in bytes.
Sourcepub fn nchar(len: u16) -> Self
pub fn nchar(len: u16) -> Self
Create type info for fixed-length NCHAR (NCHARTYPE / 0xEF), length in characters.
Sourcepub fn binary(len: u16) -> Self
pub fn binary(len: u16) -> Self
Create type info for fixed-length BINARY (BIGBINARYTYPE / 0xAD), length in bytes.
Sourcepub fn uniqueidentifier() -> Self
pub fn uniqueidentifier() -> Self
Create type info for UNIQUEIDENTIFIER.
Sourcepub fn datetimeoffset(scale: u8) -> Self
pub fn datetimeoffset(scale: u8) -> Self
Create type info for DATETIMEOFFSET.
Sourcepub fn smallmoney() -> Self
pub fn smallmoney() -> Self
Create type info for SMALLMONEY (4-byte scaled integer via MONEYN / 0x6E).
Sourcepub fn smalldatetime() -> Self
pub fn smalldatetime() -> Self
Create type info for SMALLDATETIME (4-byte days+minutes via DATETIMEN / 0x6F).
Sourcepub fn datetime() -> Self
pub fn datetime() -> Self
Create type info for legacy DATETIME (8-byte days+1/300s ticks via DATETIMEN / 0x6F).