1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! This module defines the SQL extension APIs
7 use um::sql::{
8     SQL_CHAR, SQL_DOUBLE, SQL_INTEGER, SQL_NUMERIC, SQL_REAL, SQL_SMALLINT, SQL_TYPE_DATE,
9     SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP
10 };
11 use um::sqltypes::{SQLINTEGER, SQLSMALLINT, SQLUSMALLINT};
12 pub const SQL_ATTR_ODBC_VERSION: SQLINTEGER = 200;
13 pub const SQL_ATTR_CONNECTION_POOLING: SQLINTEGER = 201;
14 pub const SQL_ATTR_CP_MATCH: SQLINTEGER = 202;
15 pub const SQL_OV_ODBC2: SQLINTEGER = 2;
16 pub const SQL_OV_ODBC3: SQLINTEGER = 3;
17 pub const SQL_OV_ODBC3_80: SQLINTEGER = 380;
18 pub const SQL_ACCESS_MODE: SQLINTEGER = 101;
19 pub const SQL_AUTOCOMMIT: SQLINTEGER = 102;
20 pub const SQL_LOGIN_TIMEOUT: SQLINTEGER = 103;
21 pub const SQL_OPT_TRACE: SQLINTEGER = 104;
22 pub const SQL_OPT_TRACEFILE: SQLINTEGER = 105;
23 pub const SQL_TRANSLATE_DLL: SQLINTEGER = 106;
24 pub const SQL_TRANSLATE_OPTION: SQLINTEGER = 107;
25 pub const SQL_TXN_ISOLATION: SQLINTEGER = 108;
26 pub const SQL_CURRENT_QUALIFIER: SQLINTEGER = 109;
27 pub const SQL_ODBC_CURSORS: SQLINTEGER = 110;
28 pub const SQL_QUIET_MODE: SQLINTEGER = 111;
29 pub const SQL_PACKET_SIZE: SQLINTEGER = 112;
30 pub const SQL_ATTR_ACCESS_MODE: SQLINTEGER = SQL_ACCESS_MODE;
31 pub const SQL_ATTR_AUTOCOMMIT: SQLINTEGER = SQL_AUTOCOMMIT;
32 pub const SQL_ATTR_CONNECTION_TIMEOUT: SQLINTEGER = 113;
33 pub const SQL_ATTR_CURRENT_CATALOG: SQLINTEGER = SQL_CURRENT_QUALIFIER;
34 pub const SQL_ATTR_DISCONNECT_BEHAVIOR: SQLINTEGER = 114;
35 pub const SQL_ATTR_ENLIST_IN_DTC: SQLINTEGER = 1207;
36 pub const SQL_ATTR_ENLIST_IN_XA: SQLINTEGER = 1208;
37 pub const SQL_ATTR_LOGIN_TIMEOUT: SQLINTEGER = SQL_LOGIN_TIMEOUT;
38 pub const SQL_ATTR_ODBC_CURSORS: SQLINTEGER = SQL_ODBC_CURSORS;
39 pub const SQL_ATTR_PACKET_SIZE: SQLINTEGER = SQL_PACKET_SIZE;
40 pub const SQL_ATTR_QUIET_MODE: SQLINTEGER = SQL_QUIET_MODE;
41 pub const SQL_ATTR_TRACE: SQLINTEGER = SQL_OPT_TRACE;
42 pub const SQL_ATTR_TRACEFILE: SQLINTEGER = SQL_OPT_TRACEFILE;
43 pub const SQL_ATTR_TRANSLATE_LIB: SQLINTEGER = SQL_TRANSLATE_DLL;
44 pub const SQL_ATTR_TRANSLATE_OPTION: SQLINTEGER = SQL_TRANSLATE_OPTION;
45 pub const SQL_ATTR_TXN_ISOLATION: SQLINTEGER = SQL_TXN_ISOLATION;
46 pub const SQL_ATTR_CONNECTION_DEAD: SQLINTEGER = 1209;
47 pub const SQL_IS_POINTER: SQLINTEGER = -4;
48 pub const SQL_IS_UINTEGER: SQLINTEGER = -5;
49 pub const SQL_IS_INTEGER: SQLINTEGER = -6;
50 pub const SQL_IS_USMALLINT: SQLINTEGER = -7;
51 pub const SQL_IS_SMALLINT: SQLINTEGER = -8;
52 pub const SQL_DATE: SQLSMALLINT = 9;
53 pub const SQL_INTERVAL: SQLSMALLINT = 10;
54 pub const SQL_TIME: SQLSMALLINT = 10;
55 pub const SQL_TIMESTAMP: SQLSMALLINT = 11;
56 pub const SQL_LONGVARCHAR: SQLSMALLINT = -1;
57 pub const SQL_BINARY: SQLSMALLINT = -2;
58 pub const SQL_VARBINARY: SQLSMALLINT = -3;
59 pub const SQL_LONGVARBINARY: SQLSMALLINT = -4;
60 pub const SQL_BIGINT: SQLSMALLINT = -5;
61 pub const SQL_TINYINT: SQLSMALLINT = -6;
62 pub const SQL_BIT: SQLSMALLINT = -7;
63 pub const SQL_GUID: SQLSMALLINT = -11;
64 pub const SQL_C_CHAR: SQLSMALLINT = SQL_CHAR;
65 pub const SQL_C_LONG: SQLSMALLINT = SQL_INTEGER;
66 pub const SQL_C_SHORT: SQLSMALLINT = SQL_SMALLINT;
67 pub const SQL_C_FLOAT: SQLSMALLINT = SQL_REAL;
68 pub const SQL_C_DOUBLE: SQLSMALLINT = SQL_DOUBLE;
69 pub const SQL_C_NUMERIC: SQLSMALLINT = SQL_NUMERIC;
70 pub const SQL_C_DEFAULT: SQLSMALLINT = 99;
71 pub const SQL_SIGNED_OFFSET: SQLSMALLINT = -20;
72 pub const SQL_UNSIGNED_OFFSET: SQLSMALLINT = -22;
73 pub const SQL_C_DATE: SQLSMALLINT = SQL_DATE;
74 pub const SQL_C_TIME: SQLSMALLINT = SQL_TIME;
75 pub const SQL_C_TIMESTAMP: SQLSMALLINT = SQL_TIMESTAMP;
76 pub const SQL_C_TYPE_DATE: SQLSMALLINT = SQL_TYPE_DATE;
77 pub const SQL_C_TYPE_TIME: SQLSMALLINT = SQL_TYPE_TIME;
78 pub const SQL_C_TYPE_TIMESTAMP: SQLSMALLINT = SQL_TYPE_TIMESTAMP;
79 pub const SQL_C_BINARY: SQLSMALLINT = SQL_BINARY;
80 pub const SQL_C_BIT: SQLSMALLINT = SQL_BIT;
81 pub const SQL_C_SBIGINT: SQLSMALLINT = SQL_BIGINT + SQL_SIGNED_OFFSET;
82 pub const SQL_C_UBIGINT: SQLSMALLINT = SQL_BIGINT + SQL_UNSIGNED_OFFSET;
83 pub const SQL_C_TINYINT: SQLSMALLINT = SQL_TINYINT;
84 pub const SQL_C_SLONG: SQLSMALLINT = SQL_C_LONG + SQL_SIGNED_OFFSET;
85 pub const SQL_C_SSHORT: SQLSMALLINT = SQL_C_SHORT + SQL_SIGNED_OFFSET;
86 pub const SQL_C_STINYINT: SQLSMALLINT = SQL_TINYINT + SQL_SIGNED_OFFSET;
87 pub const SQL_C_ULONG: SQLSMALLINT = SQL_C_LONG + SQL_UNSIGNED_OFFSET;
88 pub const SQL_C_USHORT: SQLSMALLINT = SQL_C_SHORT + SQL_UNSIGNED_OFFSET;
89 pub const SQL_C_UTINYINT: SQLSMALLINT = SQL_TINYINT + SQL_UNSIGNED_OFFSET;
90 pub const SQL_C_GUID: SQLSMALLINT = SQL_GUID;
91 pub const SQL_TYPE_NULL: SQLSMALLINT = 0;
92 pub const SQL_DRIVER_NOPROMPT: SQLUSMALLINT = 0;
93 pub const SQL_DRIVER_COMPLETE: SQLUSMALLINT = 1;
94 pub const SQL_DRIVER_PROMPT: SQLUSMALLINT = 2;
95 pub const SQL_DRIVER_COMPLETE_REQUIRED: SQLUSMALLINT = 3;
96