Skip to content

Commit 1e6c442

Browse files
mattChiaravallotinbagnard
authored andcommitted
SQL-2499: Add support for InfoType::SQL_KEYWORDS (mongodb#277)
* SQL-2499: Add support for InfoType::SQL_KEYWORDS * SQL-2499: Remove ORDER keyword
1 parent 5875d5c commit 1e6c442

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

constants/src/lib.rs

+32
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,38 @@ lazy_static! {
2222
pub static ref DEFAULT_APP_NAME: String =
2323
format!("{}+{}", DRIVER_SHORT_NAME, DRIVER_METRICS_VERSION.as_str());
2424
pub static ref DRIVER_ODBC_VERSION: String = format_driver_version();
25+
pub static ref KEYWORDS: String = [
26+
"AGGREGATE".to_string(),
27+
"ARRAY".to_string(),
28+
"BINDATA".to_string(),
29+
"BOOL".to_string(),
30+
"BOOLEAN".to_string(),
31+
"BSON_DATE".to_string(),
32+
"BSON_TIMESTAMP".to_string(),
33+
"DBPOINTER".to_string(),
34+
"DEPTH".to_string(),
35+
"DOCUMENT".to_string(),
36+
"ERROR".to_string(),
37+
"FLATTEN".to_string(),
38+
"JAVASCRIPT".to_string(),
39+
"JAVASCRIPTWITHSCOPE".to_string(),
40+
"LIMIT".to_string(),
41+
"LONG".to_string(),
42+
"MAXKEY".to_string(),
43+
"MINKEY".to_string(),
44+
"MISSING".to_string(),
45+
"NUMBER".to_string(),
46+
"OBJECTID".to_string(),
47+
"OFFSET".to_string(),
48+
"PATH".to_string(),
49+
"REGEX".to_string(),
50+
"SEPARATOR".to_string(),
51+
"STRING".to_string(),
52+
"SYMBOL".to_string(),
53+
"UNDEFINED".to_string(),
54+
"UNWIND".to_string(),
55+
]
56+
.join(",");
2557
}
2658

2759
// The default max string length if a user enables max string length.

odbc/src/api/functions.rs

+8
Original file line numberDiff line numberDiff line change
@@ -2879,6 +2879,14 @@ macro_rules! sql_get_info_helper {
28792879
string_length_ptr,
28802880
)
28812881
}
2882+
InfoType::SQL_KEYWORDS => {
2883+
i16_len::set_output_wstring_as_bytes(
2884+
KEYWORDS.as_str(),
2885+
info_value_ptr,
2886+
buffer_length as usize,
2887+
string_length_ptr,
2888+
)
2889+
}
28822890
_ => {
28832891
err = Some(ODBCError::UnsupportedInfoTypeRetrieval(
28842892
info_type.to_string(),

0 commit comments

Comments
 (0)