mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Save
This commit is contained in:
parent
5bac9fd131
commit
87a576563b
2 changed files with 32 additions and 2 deletions
15
examples/parse_select.rs
Normal file
15
examples/parse_select.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
extern crate sqlparser;
|
||||
|
||||
use sqlparser::sqlparser::*;
|
||||
|
||||
fn main() {
|
||||
|
||||
let sql = "SELECT a, b, 123, myfunc(b) \
|
||||
FROM table_1 \
|
||||
WHERE a > b AND b < 100 \
|
||||
ORDER BY a DESC, b";
|
||||
|
||||
let ast = Parser::parse_sql(sql.to_string()).unwrap();
|
||||
|
||||
println!("AST: {:?}", ast);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue