mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Introduce concept of dialects
This commit is contained in:
parent
cc725791de
commit
06a8870bd7
7 changed files with 184 additions and 92 deletions
|
@ -1,5 +1,6 @@
|
|||
extern crate sqlparser;
|
||||
|
||||
use sqlparser::dialect::AnsiSqlDialect;
|
||||
use sqlparser::sqlparser::*;
|
||||
|
||||
fn main() {
|
||||
|
@ -8,7 +9,9 @@ fn main() {
|
|||
WHERE a > b AND b < 100 \
|
||||
ORDER BY a DESC, b";
|
||||
|
||||
let ast = Parser::parse_sql(sql.to_string()).unwrap();
|
||||
let dialect = AnsiSqlDialect{};
|
||||
|
||||
let ast = Parser::parse_sql(&dialect,sql.to_string()).unwrap();
|
||||
|
||||
println!("AST: {:?}", ast);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue