1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
use crate;
use crateSQLSMALLINT;
use odbc_type;
;
;
;
/// Data type cannot be determined
pub const SQL_UNKNOWN_TYPE: SqlTypeV3 = SqlTypeV3;
/// Column whose type may vary across rows
pub const SQL_VARIANT_TYPE: SqlTypeV4 = SqlTypeV4;
/// Character string of fixed string length n.
///
/// SQL data type: CHAR(n)
pub const SQL_CHAR: SqlTypeV3 = SqlTypeV3;
/// Variable-length character string with a maximum string length n.
///
/// SQL data type: VARCHAR(n)
pub const SQL_VARCHAR: SqlTypeV3 = SqlTypeV3;
/// Variable length character data. Maximum length is data source-dependent.
///
/// SQL data type: LONG VARCHAR
pub const SQL_LONGVARCHAR: SqlTypeV3 = SqlTypeV3;
/// Unicode character string of fixed string length n
///
/// SQL data type: WCHAR(n)
pub const SQL_WCHAR: SqlTypeV3 = SqlTypeV3;
/// Unicode variable-length character string with a maximum string length n
///
/// SQL data type: VARWCHAR(n)
pub const SQL_WVARCHAR: SqlTypeV3 = SqlTypeV3;
/// Unicode variable-length character data. Maximum length is data source-dependent
///
/// SQL data type: LONGWVARCHAR
pub const SQL_WLONGVARCHAR: SqlTypeV3 = SqlTypeV3;
/// Signed, exact, numeric value with a precision of at least p and scale s. (The maximum precision is driver-defined.) (1 <= p <= 15; s <= p).
///
/// SQL data type: DECIMAL(p,s)
pub const SQL_DECIMAL: SqlTypeV3 = SqlTypeV3;
/// Signed, exact, numeric value with a precision p and scale s (1 <= p <= 15; s <= p).
///
/// SQL data type: NUMERIC(p,s)
pub const SQL_NUMERIC: SqlTypeV3 = SqlTypeV3;
/// Exact numeric value with precision 5 and scale 0 (signed: -32,768 <= n <= 32,767, unsigned: 0 <= n <= 65,535).
///
/// SQL data type: SMALLINT
pub const SQL_SMALLINT: SqlTypeV3 = SqlTypeV3;
/// Exact numeric value with precision 10 and scale 0 (signed: -2[31] <= n <= 2[31] - 1, unsigned: 0 <= n <= 2[32] - 1).
///
/// SQL data type: INTEGER
pub const SQL_INTEGER: SqlTypeV3 = SqlTypeV3;
/// Signed, approximate, numeric value with a binary precision 24 (zero or absolute value 10[-38] to 10[38]).
///
/// SQL data type: REAL
pub const SQL_REAL: SqlTypeV3 = SqlTypeV3;
/// Signed, approximate, numeric value with a binary precision of at least p. (The maximum precision is driver-defined.)
///
/// SQL data type: FLOAT(p)
pub const SQL_FLOAT: SqlTypeV3 = SqlTypeV3;
/// Signed, approximate, numeric value with a binary precision 53 (zero or absolute value 10[-308] to 10[308]).
///
/// SQL data type: DOUBLE PRECISION
pub const SQL_DOUBLE: SqlTypeV3 = SqlTypeV3;
/// Single bit binary data.
///
/// SQL data type: BIT
pub const SQL_BIT: SqlTypeV3 = SqlTypeV3;
/// Exact numeric value with precision 3 and scale 0 (signed: -128 <= n <= 127, unsigned: 0 <= n <= 255).
///
/// SQL data type: TINYINT
pub const SQL_TINYINT: SqlTypeV3 = SqlTypeV3;
/// Exact numeric value with precision 19 (if signed) or 20 (if unsigned) and scale 0 (signed: -2[63] <= n <= 2[63] - 1, unsigned: 0 <= n <= 2[64] - 1),.
///
/// SQL data type: BIGINT
pub const SQL_BIGINT: SqlTypeV3 = SqlTypeV3;
/// Binary data of fixed length n.
///
/// SQL data type: BINARY(n)
pub const SQL_BINARY: SqlTypeV3 = SqlTypeV3;
/// Variable length binary data of maximum length n. The maximum is set by the user.
///
/// SQL data type: VARBINARY(n)
pub const SQL_VARBINARY: SqlTypeV3 = SqlTypeV3;
/// Variable length binary data. Maximum length is data source-dependent.
///
/// SQL data type: LONG VARBINARY
pub const SQL_LONGVARBINARY: SqlTypeV3 = SqlTypeV3;
/// Fixed length GUID.
///
/// SQL data type: GUID
// TODO: This is V3_5
pub const SQL_GUID: SqlTypeV3_8 = SqlTypeV3_8;
/// Year, month, and day fields, conforming to the rules of the Gregorian calendar. (See Constraints of the Gregorian Calendar, later in this appendix.)
///
/// SQL data type: DATE
pub const SQL_TYPE_DATE: SqlTypeV3 = SqlTypeV3;
/// Hour, minute, and second fields, with valid values for hours of 00 to 23, valid values for minutes of 00 to 59, and valid values for seconds of 00 to 61. Precision p indicates the seconds precision.
///
/// SQL data type: TIME(p)
pub const SQL_TYPE_TIME: SqlTypeV3 = SqlTypeV3;
/// Year, month, day, hour, minute, and second fields, with valid values as defined for the DATE and TIME data types.
///
/// SQL data type: TIMESTAMP(p)
pub const SQL_TYPE_TIMESTAMP: SqlTypeV3 = SqlTypeV3;
pub const SQL_TYPE_TIME_WITH_TIMEZONE: SqlTypeV4 = SqlTypeV4;
pub const SQL_TYPE_TIMESTAMP_WITH_TIMEZONE: SqlTypeV4 = SqlTypeV4;
// TODO: These are not found in the reference implementation but exist in documentation
// /// Year, month, day, hour, minute, second, utchour, and utcminute fields. The utchour and utcminute fields have 1/10 microsecond precision.
// ///
// /// SQL data type: UTCDATETIME
// pub const SQL_TYPE_UTCDATETIME: SqlTypeV3 = SqlTypeV3(x);
//
// /// Hour, minute, second, utchour, and utcminute fields. The utchour and utcminute fields have 1/10 microsecond precision..
// ///
// /// SQL data type: UTCTIME
// pub const SQL_TYPE_UTCTIME: SqlTypeV3 = SqlTypeV3(x);
/// Number of months between two dates; p is the interval leading precision.
///
/// SQL data type: INTERVAL MONTH(p)
pub const SQL_INTERVAL_MONTH: SqlTypeV3 = SqlTypeV3;
/// Number of years between two dates; p is the interval leading precision.
///
/// SQL data type: INTERVAL YEAR(p)
pub const SQL_INTERVAL_YEAR: SqlTypeV3 = SqlTypeV3;
/// Number of years and months between two dates; p is the interval leading precision.
///
/// SQL data type: INTERVAL YEAR(p) TO MONTH
pub const SQL_INTERVAL_YEAR_TO_MONTH: SqlTypeV3 = SqlTypeV3;
/// Number of days between two dates; p is the interval leading precision.
///
/// SQL data type: INTERVAL DAY(p)
pub const SQL_INTERVAL_DAY: SqlTypeV3 = SqlTypeV3;
/// Number of hours between two date/times; p is the interval leading precision.
///
/// SQL data type: INTERVAL HOUR(p)
pub const SQL_INTERVAL_HOUR: SqlTypeV3 = SqlTypeV3;
/// Number of minutes between two date/times; p is the interval leading precision.
///
/// SQL data type: INTERVAL MINUTE(p)
pub const SQL_INTERVAL_MINUTE: SqlTypeV3 = SqlTypeV3;
/// Number of seconds between two date/times; p is the interval leading precision and q is the interval seconds precision.
///
/// SQL data type: INTERVAL SECOND(p,q)
pub const SQL_INTERVAL_SECOND: SqlTypeV3 = SqlTypeV3;
/// Number of days/hours between two date/times; p is the interval leading precision.
///
/// SQL data type: INTERVAL DAY(p) TO HOUR
pub const SQL_INTERVAL_DAY_TO_HOUR: SqlTypeV3 = SqlTypeV3;
/// Number of days/hours/minutes between two date/times; p is the interval leading precision.
///
/// SQL data type: INTERVAL DAY(p) TO MINUTE
pub const SQL_INTERVAL_DAY_TO_MINUTE: SqlTypeV3 = SqlTypeV3;
/// Number of days/hours/minutes/seconds between two date/times; p is the interval leading precision and q is the interval seconds precision.
///
/// SQL data type: INTERVAL DAY(p) TO SECOND(q)
pub const SQL_INTERVAL_DAY_TO_SECOND: SqlTypeV3 = SqlTypeV3;
/// Number of hours/minutes between two date/times; p is the interval leading precision.
///
/// SQL data type: INTERVAL HOUR(p) TO MINUTE
pub const SQL_INTERVAL_HOUR_TO_MINUTE: SqlTypeV3 = SqlTypeV3;
/// Number of hours/minutes/seconds between two date/times; p is the interval leading precision and q is the interval seconds precision.
///
/// SQL data type: INTERVAL HOUR(p) TO SECOND(q)
pub const SQL_INTERVAL_HOUR_TO_SECOND: SqlTypeV3 = SqlTypeV3;
/// Number of minutes/seconds between two date/times; p is the interval leading precision and q is the interval seconds precision.
///
/// SQL data type: INTERVAL MINUTE(p) TO SECOND(q)
pub const SQL_INTERVAL_MINUTE_TO_SECOND: SqlTypeV3 = SqlTypeV3;
pub const SQL_UDT: SqlTypeV4 = SqlTypeV4;
pub const SQL_ROW: SqlTypeV4 = SqlTypeV4;
pub const SQL_ARRAY: SqlTypeV4 = SqlTypeV4;
pub const SQL_MULTISET: SqlTypeV4 = SqlTypeV4;
// =================================================================================== //
/// Datetime verbose type identifier.
pub const SQL_DATETIME: SqlTypeV3 = SqlTypeV3;
/// Interval verbose type identifier.
pub const SQL_INTERVAL: SqlTypeV3 = SqlTypeV3;
;
// Subcodes for the specific verbose datetime data type
pub const SQL_CODE_DATE: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_TIME: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_TIMESTAMP: DatetimeIntervalCode = DatetimeIntervalCode;
// Subcode for the specific verbose interval data type
pub const SQL_CODE_YEAR: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_MONTH: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_DAY: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_HOUR: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_MINUTE: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_SECOND: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_YEAR_TO_MONTH: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_DAY_TO_HOUR: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_DAY_TO_MINUTE: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_DAY_TO_SECOND: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_HOUR_TO_MINUTE: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_HOUR_TO_SECOND: DatetimeIntervalCode = DatetimeIntervalCode;
pub const SQL_CODE_MINUTE_TO_SECOND: DatetimeIntervalCode = DatetimeIntervalCode;