-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add keyword and functions support for sqlinfo (#269)
- Loading branch information
1 parent
6ec21af
commit cdba7a7
Showing
3 changed files
with
311 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,299 @@ | ||
// from https://github.com/influxdata/influxdb3_core/blob/main/flightsql/src/sql_info/ | ||
|
||
pub const SQL_INFO_SQL_KEYWORDS: &[&str] = &[ | ||
// SQL-92 Reserved Words | ||
"absolute", | ||
"action", | ||
"add", | ||
"all", | ||
"allocate", | ||
"alter", | ||
"and", | ||
"any", | ||
"are", | ||
"as", | ||
"asc", | ||
"assertion", | ||
"at", | ||
"authorization", | ||
"avg", | ||
"begin", | ||
"between", | ||
"bit", | ||
"bit_length", | ||
"both", | ||
"by", | ||
"cascade", | ||
"cascaded", | ||
"case", | ||
"cast", | ||
"catalog", | ||
"char", | ||
"char_length", | ||
"character", | ||
"character_length", | ||
"check", | ||
"close", | ||
"coalesce", | ||
"collate", | ||
"collation", | ||
"column", | ||
"commit", | ||
"connect", | ||
"connection", | ||
"constraint", | ||
"constraints", | ||
"continue", | ||
"convert", | ||
"corresponding", | ||
"count", | ||
"create", | ||
"cross", | ||
"current", | ||
"current_date", | ||
"current_time", | ||
"current_timestamp", | ||
"current_user", | ||
"cursor", | ||
"date", | ||
"day", | ||
"deallocate", | ||
"dec", | ||
"decimal", | ||
"declare", | ||
"default", | ||
"deferrable", | ||
"deferred", | ||
"delete", | ||
"desc", | ||
"describe", | ||
"descriptor", | ||
"diagnostics", | ||
"disconnect", | ||
"distinct", | ||
"domain", | ||
"double", | ||
"drop", | ||
"else", | ||
"end", | ||
"end-exec", | ||
"escape", | ||
"except", | ||
"exception", | ||
"exec", | ||
"execute", | ||
"exists", | ||
"external", | ||
"extract", | ||
"false", | ||
"fetch", | ||
"first", | ||
"float", | ||
"for", | ||
"foreign", | ||
"found", | ||
"from", | ||
"full", | ||
"get", | ||
"global", | ||
"go", | ||
"goto", | ||
"grant", | ||
"group", | ||
"having", | ||
"hour", | ||
"identity", | ||
"immediate", | ||
"in", | ||
"indicator", | ||
"initially", | ||
"inner", | ||
"input", | ||
"insensitive", | ||
"insert", | ||
"int", | ||
"integer", | ||
"intersect", | ||
"interval", | ||
"into", | ||
"is", | ||
"isolation", | ||
"join", | ||
"key", | ||
"language", | ||
"last", | ||
"leading", | ||
"left", | ||
"level", | ||
"like", | ||
"local", | ||
"lower", | ||
"match", | ||
"max", | ||
"min", | ||
"minute", | ||
"module", | ||
"month", | ||
"names", | ||
"national", | ||
"natural", | ||
"nchar", | ||
"next", | ||
"no", | ||
"not", | ||
"null", | ||
"nullif", | ||
"numeric", | ||
"octet_length", | ||
"of", | ||
"on", | ||
"only", | ||
"open", | ||
"option", | ||
"or", | ||
"order", | ||
"outer", | ||
"output", | ||
"overlaps", | ||
"pad", | ||
"partial", | ||
"position", | ||
"precision", | ||
"prepare", | ||
"preserve", | ||
"primary", | ||
"prior", | ||
"privileges", | ||
"procedure", | ||
"public", | ||
"read", | ||
"real", | ||
"references", | ||
"relative", | ||
"restrict", | ||
"revoke", | ||
"right", | ||
"rollback", | ||
"rows", | ||
"schema", | ||
"scroll", | ||
"second", | ||
"section", | ||
"select", | ||
"session", | ||
"session_user", | ||
"set", | ||
"size", | ||
"smallint", | ||
"some", | ||
"space", | ||
"sql", | ||
"sqlcode", | ||
"sqlerror", | ||
"sqlstate", | ||
"substring", | ||
"sum", | ||
"system_user", | ||
"table", | ||
"temporary", | ||
"then", | ||
"time", | ||
"timestamp", | ||
"timezone_hour", | ||
"timezone_minute", | ||
"to", | ||
"trailing", | ||
"transaction", | ||
"translate", | ||
"translation", | ||
"trim", | ||
"true", | ||
"union", | ||
"unique", | ||
"unknown", | ||
"update", | ||
"upper", | ||
"usage", | ||
"user", | ||
"using", | ||
"value", | ||
"values", | ||
"varchar", | ||
"varying", | ||
"view", | ||
"when", | ||
"whenever", | ||
"where", | ||
"with", | ||
"work", | ||
"write", | ||
"year", | ||
"zone", | ||
]; | ||
|
||
pub const SQL_INFO_NUMERIC_FUNCTIONS: &[&str] = &[ | ||
"abs", "acos", "asin", "atan", "atan2", "ceil", "cos", "exp", "floor", "ln", "log", "log10", | ||
"log2", "pow", "power", "round", "signum", "sin", "sqrt", "tan", "trunc", | ||
]; | ||
|
||
pub const SQL_INFO_DATE_TIME_FUNCTIONS: &[&str] = &[ | ||
"current_date", | ||
"current_time", | ||
"date_bin", | ||
"date_part", | ||
"date_trunc", | ||
"datepart", | ||
"datetrunc", | ||
"from_unixtime", | ||
"now", | ||
"to_timestamp", | ||
"to_timestamp_micros", | ||
"to_timestamp_millis", | ||
"to_timestamp_seconds", | ||
]; | ||
|
||
pub const SQL_INFO_SYSTEM_FUNCTIONS: &[&str] = &["array", "arrow_typeof", "struct"]; | ||
|
||
pub const SQL_INFO_STRING_FUNCTIONS: &[&str] = &[ | ||
"arrow_typeof", | ||
"ascii", | ||
"bit_length", | ||
"btrim", | ||
"char_length", | ||
"character_length", | ||
"chr", | ||
"concat", | ||
"concat_ws", | ||
"digest", | ||
"from_unixtime", | ||
"initcap", | ||
"left", | ||
"length", | ||
"lower", | ||
"lpad", | ||
"ltrim", | ||
"md5", | ||
"octet_length", | ||
"random", | ||
"regexp_match", | ||
"regexp_replace", | ||
"repeat", | ||
"replace", | ||
"reverse", | ||
"right", | ||
"rpad", | ||
"rtrim", | ||
"sha224", | ||
"sha256", | ||
"sha384", | ||
"sha512", | ||
"split_part", | ||
"starts_with", | ||
"strpos", | ||
"substr", | ||
"to_hex", | ||
"translate", | ||
"trim", | ||
"upper", | ||
"uuid", | ||
]; |