odbc_sys/
c_data_type.rs

1/// Extended C Types range 4000 and above. Range of -100 thru 200 is reserved by Driver Manager.
2/// `SQL_C_TYPES_EXTENDED`.
3pub const C_TYPES_EXTENDED: i16 = 0x04000;
4
5/// The C data type is specified in the SQLBindCol and SQLGetData functions with the TargetType
6/// argument and in the SQLBindParameter function with the ValueType argument.
7#[repr(i16)]
8#[derive(Debug, PartialEq, Eq, Clone, Copy)]
9pub enum CDataType {
10    /// SQL_ARD_TYPE
11    Ard = -99,
12
13    /// SQL_APD_TYPE
14    Apd = -100,
15
16    UTinyInt = -28,
17    UBigInt = -27,
18    STinyInt = -26,
19    SBigInt = -25,
20
21    ULong = -18,
22    UShort = -17,
23    SLong = -16,
24    SShort = -15,
25
26    #[cfg(feature = "odbc_version_3_50")]
27    Guid = -11,
28
29    WChar = -8,
30
31    Bit = -7,
32    // deprecated
33    // SQL_C_TINYINT = -6,
34    Binary = -2,
35    /// `SQLCHAR` - CHAR, VARCHAR, DECIMAL, NUMERIC
36    Char = 1,
37    Numeric = 2,
38
39    // deprecated
40    // SQL_C_LONG = 4,
41    // SQL_C_SHORT = 5,
42    Float = 7,
43    Double = 8,
44
45    // Used in Odbc2.x Odbc3.x uses TypeDate instead.
46    Date = 9,
47    // Used in Odbc2.x Odbc3.x uses TypeTime instead.
48    Time = 10,
49    // Used in Odbc2.x Odbc3.x uses TypeTimeTimestamp instead.
50    TimeStamp = 11,
51
52    /// SQL_TYPE_DATE
53    TypeDate = 91,
54    /// SQL_TYPE_TIME
55    TypeTime = 92,
56    /// SQL_TYPE_TIMESTAMP
57    TypeTimestamp = 93,
58    #[cfg(feature = "odbc_version_4")]
59    TypeTimeWithTimezone = 94,
60    #[cfg(feature = "odbc_version_4")]
61    TypeTimestampWithTimezone = 95,
62
63    Default = 99,
64
65    IntervalYear = 101,
66    IntervalMonth = 102,
67    IntervalDay = 103,
68    IntervalHour = 104,
69    IntervalMinute = 105,
70    IntervalSecond = 106,
71    IntervalYearToMonth = 107,
72    IntervalDayToHour = 108,
73    IntervalDayToMinute = 109,
74    IntervalDayToSecond = 110,
75    IntervalHourToMinute = 111,
76    IntervalHourToSecond = 112,
77    IntervalMinuteToSecond = 113,
78
79    SsTime2 = C_TYPES_EXTENDED,
80    SsTimestampOffset = C_TYPES_EXTENDED + 1,
81}
82
83#[cfg(windows)]
84pub use CDataType::ULong as UBigInt;
85#[cfg(not(windows))]
86pub use CDataType::ULong as Bookmark;