mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-09 23:46:20 +00:00
Turn type Ident into struct Ident
The Ident type was previously an alias for a String. Turn it into a full fledged struct, so that the parser can preserve the distinction between identifier value and quote style already made by the tokenizer's Word structure.
This commit is contained in:
parent
9b2287f14c
commit
b1cbc55128
6 changed files with 160 additions and 88 deletions
|
@ -23,11 +23,11 @@ fn parse_mssql_identifiers() {
|
|||
let sql = "SELECT @@version, _foo$123 FROM ##temp";
|
||||
let select = ms_and_generic().verified_only_select(sql);
|
||||
assert_eq!(
|
||||
&Expr::Identifier("@@version".to_string()),
|
||||
&Expr::Identifier(Ident::new("@@version")),
|
||||
expr_from_projection(&select.projection[0]),
|
||||
);
|
||||
assert_eq!(
|
||||
&Expr::Identifier("_foo$123".to_string()),
|
||||
&Expr::Identifier(Ident::new("_foo$123")),
|
||||
expr_from_projection(&select.projection[1]),
|
||||
);
|
||||
assert_eq!(2, select.projection.len());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue