mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 03:07:20 +00:00
Use binary search to speed up matching keywords (#191)
This commit is contained in:
parent
af54eb02b2
commit
a42121de52
3 changed files with 27 additions and 18 deletions
|
@ -21,6 +21,7 @@
|
|||
use matches::assert_matches;
|
||||
|
||||
use sqlparser::ast::*;
|
||||
use sqlparser::dialect::keywords::ALL_KEYWORDS;
|
||||
use sqlparser::parser::*;
|
||||
use sqlparser::test_utils::{all_dialects, expr_from_projection, number, only};
|
||||
|
||||
|
@ -2851,6 +2852,14 @@ fn parse_drop_index() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn keywords_sorted() {
|
||||
// assert!(ALL_KEYWORDS.is_sorted())
|
||||
let mut copy = Vec::from(ALL_KEYWORDS);
|
||||
copy.sort();
|
||||
assert!(copy == ALL_KEYWORDS)
|
||||
}
|
||||
|
||||
fn parse_sql_statements(sql: &str) -> Result<Vec<Statement>, ParserError> {
|
||||
all_dialects().parse_sql_statements(sql)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue