Enum hdbconnect::HdbValue [] [src]

pub enum HdbValue {
    NOTHING,
    TINYINT(u8),
    SMALLINT(i16),
    INT(i32),
    BIGINT(i64),
    DECIMAL(HdbDecimal),
    REAL(f32),
    DOUBLE(f64),
    CHAR(String),
    VARCHAR(String),
    NCHAR(String),
    NVARCHAR(String),
    BINARY(Vec<u8>),
    VARBINARY(Vec<u8>),
    CLOB(CLOB),
    NCLOB(CLOB),
    BLOB(BLOB),
    BOOLEAN(bool),
    STRING(String),
    NSTRING(String),
    BSTRING(Vec<u8>),
    TEXT(String),
    SHORTTEXT(String),
    LONGDATE(LongDate),
    N_TINYINT(Option<u8>),
    N_SMALLINT(Option<i16>),
    N_INT(Option<i32>),
    N_BIGINT(Option<i64>),
    N_DECIMAL(Option<HdbDecimal>),
    N_REAL(Option<f32>),
    N_DOUBLE(Option<f64>),
    N_CHAR(Option<String>),
    N_VARCHAR(Option<String>),
    N_NCHAR(Option<String>),
    N_NVARCHAR(Option<String>),
    N_BINARY(Option<Vec<u8>>),
    N_VARBINARY(Option<Vec<u8>>),
    N_CLOB(Option<CLOB>),
    N_NCLOB(Option<CLOB>),
    N_BLOB(Option<BLOB>),
    N_BOOLEAN(Option<bool>),
    N_STRING(Option<String>),
    N_NSTRING(Option<String>),
    N_BSTRING(Option<Vec<u8>>),
    N_TEXT(Option<String>),
    N_SHORTTEXT(Option<String>),
    N_LONGDATE(Option<LongDate>),
}

Enum for all supported database value types.

Variants

Internally swapped in where a real value is swapped out

TINYINT stores an 8-bit unsigned integer. The minimum value is 0. The maximum value is 255.

SMALLINT stores a 16-bit signed integer. The minimum value is -32,768. The maximum value is 32,767.

INT stores a 32-bit signed integer. The minimum value is -2,147,483,648. The maximum value is 2,147,483,647.

BIGINT stores a 64-bit signed integer. The minimum value is -9,223,372,036,854,775,808. The maximum value is 9,223,372,036,854,775,807.

DECIMAL(p, s) is the SQL standard notation for fixed-point decimal. "p" specifies precision or the number of total digits (the sum of whole digits and fractional digits). "s" denotes scale or the number of fractional digits. If a column is defined as DECIMAL(5, 4) for example, the numbers 3.14, 3.1415, 3.141592 are stored in the column as 3.1400, 3.1415, 3.1415, retaining the specified precision(5) and scale(4).

Precision p, can range from 1 to 38. The scale can range from 0 to p. If the scale is not specified, it defaults to 0. If precision and scale are not specified, DECIMAL becomes a floating-point decimal number. In this case, precision and scale can vary within the range 1 to 34 for precision and -6,111 to 6,176 for scale, depending on the stored value.

Examples: 0.0000001234 (1234E-10) has precision 4 and scale 10. 1.0000001234 (10000001234E-10) has precision 11 and scale 10. The value 1234000000 (1234E6) has precision 4 and scale -6.

REAL stores a single-precision 32-bit floating-point number.

DOUBLE stores a double-precision 64-bit floating-point number. The minimum value is -1.7976931348623157E308, the maximum value is 1.7976931348623157E308 . The smallest positive DOUBLE value is 2.2250738585072014E-308 and the largest negative DOUBLE value is -2.2250738585072014E-308.

Fixed-length character String, only ASCII-7 allowed.

The VARCHAR(n) data type specifies a variable-length character string, where n indicates the maximum length in bytes and is an integer between 1 and 5000. If the VARCHAR(n) data type is used in a DML query, for example CAST (A as VARCHAR(n)), indicates the maximum length of the string in characters. SAP recommends using VARCHAR with ASCII characters based strings only. For data containing other characters, SAP recommends using the NVARCHAR data type instead.

Fixed-length character string.

The NVARCHAR(n) data type specifies a variable-length Unicode character set string, where indicates the maximum length in characters and is an integer between 1 and 5000.

The BINARY(n) data type is used to store binary data of a specified length in bytes, where n indicates the fixed length and is an integer between 1 and 5000.

The VARBINARY(n) data type is used to store binary data of a specified maximum length in bytes, where n indicates the maximum length and is an integer between 1 and 5000.

The CLOB data type is used to store a large ASCII character string.

The NCLOB data type is used to store a large Unicode string.

The BLOB data type is used to store a large binary string.

BOOLEAN stores boolean values, which are TRUE or FALSE.

The DB returns all Strings as type STRING, independent of the concrete column type.

Likely not used?

The DB returns all binary values as type BSTRING.

The TEXT data type enables text search features. This data type can be defined for column tables, but not for row tables. This is not a standalone SQL-Type. Selecting a TEXT column yields a column of type NCLOB.

Similar to TEXT.

Timestamp, uses eight bytes.

Nullable variant of TINYINT.

Nullable variant of SMALLINT.

Nullable variant of INT.

Nullable variant of BIGINT.

Nullable variant of DECIMAL

Nullable variant of REAL.

Nullable variant of DOUBLE.

Nullable variant of CHAR.

Nullable variant of VARCHAR.

Nullable variant of NCHAR.

Nullable variant of NVARCHAR.

Nullable variant of BINARY.

Nullable variant of VARBINARY.

Nullable variant of CLOB.

Nullable variant of NCLOB.

Nullable variant of BLOB.

Nullable variant of BOOLEAN.

Nullable variant of STRING.

Nullable variant of NSTRING.

Nullable variant of BSTRING.

Nullable variant of TEXT.

Nullable variant of SHORTTEXT.

Nullable variant of LONGDATE.

Methods

impl TypedValue
[src]

[src]

Deserialize into a rust type

Trait Implementations

impl DbValue for TypedValue
[src]

[src]

Returns true if this is a NULL value.

[src]

Converts the DbValue into a plain rust value.

impl DbValueInto<bool> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<u8> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<u16> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<u32> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<u64> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<i8> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<i16> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<i32> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<i64> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<f32> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<f64> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<String> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<NaiveDateTime> for TypedValue
[src]

[src]

Tries to convert into type T.

impl DbValueInto<Vec<u8>> for TypedValue
[src]

[src]

Tries to convert into type T.

impl Clone for TypedValue
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for TypedValue
[src]

[src]

Formats the value using the given formatter.

impl Display for TypedValue
[src]

[src]

Formats the value using the given formatter. Read more