pub enum DataType {
Show 29 variants NUMERIC, NUMBER, DECIMAL, BIT, INTEGER, BIGINT, TINYINT, BYTE, SMALLINT, BINARY, VARBINARY, REAL, FLOAT, DOUBLE, DOUBLE_PRECISION, CHAR, VARCHAR, TEXT, IMAGE, BLOB, CLOB, BFILE, DATE, TIME, TIMESTAMP, TIME_WITH_TIME_ZONE, TIMESTAMP_WITH_TIME_ZONE, TIMESTAMP_WITH_LOCAL_TIME_ZONE, BOOL,
}

Variants

NUMERIC

`NUMERIC 数据类型用于存储零、正负定点数。其中:精度是一个无符号整数, 定义 了总的数字数,精度范围是 1至38,标度定义了小数点右边的数字位数,定义时如省略 精度,则默认是 16。 如省略标度,则默认是 0。一个数的标度不应大于其精度。例如: NUMERIC(4,1)定义了小数点前面 3 位和小数点后面 1 位,共 4 位的数字,范围在 - 999.9 到 999.9。 所有 NUMERIC 数据类型,如果其值超过精度,达梦数据库返回一个 出错信息,如果超过标度,则多余的位截断。 如果不指定精度和标度,缺省精度为 38。 NUMERIC[( 精度 [, 标度])]

NUMBER

与 NUMERIC 类型相同。 NUMBER[(精度 [, 标度])]

DECIMAL

与 NUMERIC 相似。 DECIMAL[(精度 [, 标度])],

BIT

BIT 类型用于存储整数数据 1、0 或 NULL,可以用来支持 ODBC 和 JDBC 的布尔数据 类型。DM 的 BIT 类型与 SQL SERVER2000 的 BIT 数据类型相似。

INTEGER

用于存储有符号整数,精度为 10,标度为 0。取值范围为:-2147483648(- 2^31)~ +2147483647(2^31-1)。

BIGINT

用于存储有符号整数,精度为 19,标度为 0。取值范围为:-9223372036854775808(-2^63)~ 9223372036854775807(2^63-1)。

TINYINT

用于存储有符号整数,精度为 3,标度为 0。取值范围为:-128~+127。

BYTE

与 TINYINT 相似,精度为 3,标度为 0。

SMALLINT

用于存储有符号整数,精度为 5,标度为 0。

BINARY

BINARY 数据类型指定定长二进制数据。缺省长度为 1 个字节,最大长度由数据库页 面大小决定,具体可参考《DM8_SQL 语言使用手册》1.4.1 节。BINARY 常量以 0x 开始, 后跟数据的十六进制表示,例如 0x2A3B4058。

VARBINARY

VARBINARY 数据类型指定变长二进制数据,用法类似 BINARY 数据类型,可以指定 一个正整数作为数据长度。缺省长度为 8188 个字节,最大长度由数据库页面大小决定, 具体可参考《DM8_SQL 语言使用手册》1.4.1 节。

REAL

REAL 是带二进制的浮点数,但它不能由用户指定使用的精度,系统指定其二进制精 度为24,十进制精度为7。取值范围-3.4E + 38 ~ 3.4E + 38。

FLOAT

FLOAT 是带二进制精度的浮点数,精度最大不超过 53,如省略精度,则二进制精度 为53,十进制精度为15。取值范围为-1.7E + 308 ~ 1.7E + 308。

DOUBLE

同 FLOAT 相似,精度最大不超过 53。

DOUBLE_PRECISION

该类型指明双精度浮点数,其二进制精度为 53,十进制精度为 15。取值范围-1.7E + 308 ~ 1.7E + 308。

CHAR

定长字符串,最大长度由数据库页面大小决定,具体可参考《DM8_SQL 语言使用手册》 1.4.1 节。长度不足时,自动填充空格。

VARCHAR

可变长字符串,最大长度由数据库页面大小决定,具体可参考《DM8_SQL 语言使用手 册》1.4.1 节。

TEXT

变长字符串类型,其字符串的长度最大为 2G-1,可用于存储长的文本串。

IMAGE

可用于存储多媒体信息中的图像类型。图像由不定长的象素点阵组成,长度最大为2G-1 字节。该类型除了存储图像数据之外,还可用于存储任何其它二进制数据。

BLOB

BLOB 类型用于指明变长的二进制大对象,长度最大为 2G-1 字节。

CLOB

CLOB 类型用于指明变长的字符串,长度最大为 2G-1 字节。

BFILE

BFILE 用于指明存储在操作系统中的二进制文件,文件存储在操作系统而非数据库中, 仅能进行只读访问。

DATE

DATE 类型包括年、月、日信息,定义了’-4712-01-01’和’9999-12-31’之间任 何一个有效的格里高利日期。

TIME

TIME 类型包括时、分、秒信息,定义了一个在’00:00:00.000000’和 ’23:59:59.999999’之间的有效时间。TIME 类型的小数秒精度规定了秒字段中小数点 后面的位数,取值范围为 0~6,如果未定义,缺省精度为 0。

TIMESTAMP

TIMESTAMP/DATETIME 类型包括年、月、日、时、分、秒信息,定义了一个在’- 4712-01-01 00:00:00.000000’和’9999-12-31 23:59:59.999999’之间的有效 格里高利日期时间。小数秒精度规定了秒字段中小数点后面的位数,取值范围为 0~6,如 果未定义,缺省精度为 6。

TIME_WITH_TIME_ZONE

描述一个带时区的 TIME 值,其定义是在 TIME 类型的后面加上时区信息。时区部分 的实质是 INTERVAL HOUR TO MINUTE 类型,取值范围:-12:59 与+14:00 之间。例 如:TIME ‘09:10:21 +8:00’

TIMESTAMP_WITH_TIME_ZONE

描述一个带时区的 TIMESTAMP 值,其定义是在 TIMESTAMP 类型的后面加上时区信 息。时区部分的实质是 INTERVAL HOUR TO MINUTE 类型,取值范围:-12:59 与 +14:00 之间。例如:’2009-10-11 19:03:05.0000 -02:10’。

TIMESTAMP_WITH_LOCAL_TIME_ZONE

描述一个本地时区的TIMESTAMP值,能够将标准时区类型TIMESTAMP WITH TIME ZONE 类型转化为本地时区类型,如果插入的值没有指定时区,则默认为本地时区。

BOOL

布尔数据类型:TRUE 和 FALSE。DMSQL 程序的布尔类型和 INT 类型可以相互转化。 如果变量或方法返回的类型是布尔类型,则返回值为 0 或 1。TRUE 和非 0 值的返回值为 1,FALSE 和 0 值返回为 0。

Trait Implementations

Formats the value using the given formatter. Read more
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Set the foreground color generically Read more
Set the background color generically. Read more
Change the foreground color to black
Change the background color to black
Change the foreground color to red
Change the background color to red
Change the foreground color to green
Change the background color to green
Change the foreground color to yellow
Change the background color to yellow
Change the foreground color to blue
Change the background color to blue
Change the foreground color to magenta
Change the background color to magenta
Change the foreground color to purple
Change the background color to purple
Change the foreground color to cyan
Change the background color to cyan
Change the foreground color to white
Change the background color to white
Change the foreground color to the terminal default
Change the background color to the terminal default
Change the foreground color to bright black
Change the background color to bright black
Change the foreground color to bright red
Change the background color to bright red
Change the foreground color to bright green
Change the background color to bright green
Change the foreground color to bright yellow
Change the background color to bright yellow
Change the foreground color to bright blue
Change the background color to bright blue
Change the foreground color to bright magenta
Change the background color to bright magenta
Change the foreground color to bright purple
Change the background color to bright purple
Change the foreground color to bright cyan
Change the background color to bright cyan
Change the foreground color to bright white
Change the background color to bright white
Make the text bold
Make the text dim
Make the text italicized
Make the text italicized
Make the text blink
Make the text blink (but fast!)
Swap the foreground and background colors
Hide the text
Cross out the text
Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Set the foreground color to a specific RGB value.
Set the background color to a specific RGB value.
Sets the foreground color to an RGB value.
Sets the background color to an RGB value.
Apply a runtime-determined style
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.