mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Accept &str in Parse::parse_sql
(#182)
It is more generic to accept a `&str` than a `String` in an API, and avoids having to convert a string to a `String` when not needed, avoiding a copy.
This commit is contained in:
parent
b4699bd4a7
commit
d32df527e6
6 changed files with 8 additions and 8 deletions
|
@ -29,7 +29,7 @@ let sql = "SELECT a, b, 123, myfunc(b) \
|
|||
|
||||
let dialect = GenericDialect {}; // or AnsiDialect, or your own dialect ...
|
||||
|
||||
let ast = Parser::parse_sql(&dialect, sql.to_string()).unwrap();
|
||||
let ast = Parser::parse_sql(&dialect, sql).unwrap();
|
||||
|
||||
println!("AST: {:?}", ast);
|
||||
```
|
||||
|
@ -122,4 +122,4 @@ resources.
|
|||
[LocustDB]: https://github.com/cswinter/LocustDB
|
||||
[Pratt Parser]: https://tdop.github.io/
|
||||
[sql-2016-grammar]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html
|
||||
[sql-standard]: https://en.wikipedia.org/wiki/ISO/IEC_9075
|
||||
[sql-standard]: https://en.wikipedia.org/wiki/ISO/IEC_9075
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue