polars_sql/
keywords.rs
1use crate::functions::PolarsSQLFunctions;
7use crate::table_functions::PolarsTableFunctions;
8
9pub fn all_keywords() -> Vec<&'static str> {
11 let mut keywords = vec![];
12 keywords.extend_from_slice(PolarsTableFunctions::keywords());
13 keywords.extend_from_slice(PolarsSQLFunctions::keywords());
14
15 use sqlparser::keywords;
16 let sql_keywords = &[
17 keywords::AND,
18 keywords::ANTI,
19 keywords::ARRAY,
20 keywords::AS,
21 keywords::ASC,
22 keywords::BOOLEAN,
23 keywords::BY,
24 keywords::CASE,
25 keywords::CREATE,
26 keywords::DATE,
27 keywords::DATETIME,
28 keywords::DESC,
29 keywords::DISTINCT,
30 keywords::DOUBLE,
31 keywords::DROP,
32 keywords::EXCEPT,
33 keywords::EXCLUDE,
34 keywords::FLOAT,
35 keywords::FROM,
36 keywords::FULL,
37 keywords::GROUP,
38 keywords::HAVING,
39 keywords::IN,
40 keywords::INNER,
41 keywords::INT,
42 keywords::INTERSECT,
43 keywords::INTERVAL,
44 keywords::JOIN,
45 keywords::LEFT,
46 keywords::LIMIT,
47 keywords::NOT,
48 keywords::NULL,
49 keywords::OFFSET,
50 keywords::ON,
51 keywords::OR,
52 keywords::ORDER,
53 keywords::OUTER,
54 keywords::REGEXP,
55 keywords::RENAME,
56 keywords::REPLACE,
57 keywords::RIGHT,
58 keywords::RLIKE,
59 keywords::SELECT,
60 keywords::SEMI,
61 keywords::SHOW,
62 keywords::TABLE,
63 keywords::TABLES,
64 keywords::THEN,
65 keywords::TIME,
66 keywords::TRUNCATE,
67 keywords::UNION,
68 keywords::USING,
69 keywords::VARCHAR,
70 keywords::WHEN,
71 keywords::WHERE,
72 keywords::WITH,
73 ];
74 keywords.extend_from_slice(sql_keywords);
75 keywords
76}
77
78pub fn all_functions() -> Vec<&'static str> {
80 let mut functions = vec![];
81 functions.extend_from_slice(PolarsTableFunctions::keywords());
82 functions.extend_from_slice(PolarsSQLFunctions::keywords());
83 functions
84}