Enum psl::builtin_connectors::MsSqlType
source · pub enum MsSqlType {
Show 27 variants
TinyInt,
SmallInt,
Int,
BigInt,
Decimal(Option<(u32, u32)>),
Money,
SmallMoney,
Bit,
Float(Option<u32>),
Real,
Date,
Time,
DateTime,
DateTime2,
DateTimeOffset,
SmallDateTime,
Char(Option<u32>),
NChar(Option<u32>),
VarChar(Option<MsSqlTypeParameter>),
Text,
NVarChar(Option<MsSqlTypeParameter>),
NText,
Binary(Option<u32>),
VarBinary(Option<MsSqlTypeParameter>),
Image,
Xml,
UniqueIdentifier,
}
Expand description
Representing a type in SQL Server database.
Variants§
TinyInt
Maps to i8
in Rust.
SmallInt
Maps to i16
in Rust.
Int
Maps to i32
in Rust.
BigInt
Maps to i64
in Rust.
Decimal(Option<(u32, u32)>)
Numeric data types that have fixed precision and scale. Decimal and numeric are synonyms and can be used interchangeably.
Money
8-byte numeric money value, accurate to a ten-thousandth of the monetary units.
SmallMoney
4-byte numeric money value, accurate to a ten-thousandth of the monetary units.
Bit
One or zero. Used mostly for booleans.
Float(Option<u32>)
A floating point value. Has two sizes: numbers 1 to 24 represent f32
,
25 to 53 represent f64
.
Real
A synonym for float(24)
/f32
.
Date
Defines a date.
Time
Defines a time.
DateTime
Defines date and time. A legacy type with a weird accuracy of 1/300th of
a second. Every new project should use the datetime2
type.
DateTime2
Defines date and time. Accurate until a 100th of a nanosecond.
DateTimeOffset
A datetime2
with the time zone information.
SmallDateTime
A datetime between 1900-01-01 through 2079-06-06. Accurate to one
minute. A legacy type, any new project should use the
time
/date
/datetime2
or datetimeoffset
types instead.
Char(Option<u32>)
A fixed size string. Before SQL Server 2019 supported only ASCII characters, and from that version on supports also UTF-8 when using the right collation.
NChar(Option<u32>)
A fixed size UTF-16 string.
VarChar(Option<MsSqlTypeParameter>)
A variable size string. Before SQL Server 2019 supported only ASCII characters, and from that version on supports also UTF-8 when using the right collation.
Text
A heap-stored ASCII string. Deprecated in favour of varchar(max)
.
NVarChar(Option<MsSqlTypeParameter>)
A variable size string, supporting the full range of unicode character data. Stores in UTF-16.
NText
A heap-stored Unicode (UTF-16) string. Deprecated in favour of
nvarchar(max)
.
Binary(Option<u32>)
A fixed size binary blob.
VarBinary(Option<MsSqlTypeParameter>)
A variable size binary blob.
Image
A heap-stored binary blob. Deprecated in favlour of varbinary(max)
.
Xml
XML text.
UniqueIdentifier
GUID, which is UUID but Microsoft invented them so they have their own term for it.