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.

Implementations§

source§

impl MsSqlType

source

pub fn to_parts(&self) -> (&'static str, Vec<String>)

source

pub fn from_parts( name: &str, arguments: &[String], span: Span, diagnostics: &mut Diagnostics ) -> Option<MsSqlType>

Trait Implementations§

source§

impl Clone for MsSqlType

source§

fn clone(&self) -> MsSqlType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MsSqlType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl PartialEq for MsSqlType

source§

fn eq(&self, other: &MsSqlType) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for MsSqlType

source§

impl StructuralPartialEq for MsSqlType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.