mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-03 22:08:16 +00:00
Add support of NVARCHAR data type (#462)
* Add support of nvarchar data type * Change the format type with capitals Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> * Add Test Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
parent
d035784bdf
commit
278345d21a
4 changed files with 17 additions and 0 deletions
|
@ -1365,6 +1365,16 @@ fn parse_cast() {
|
|||
"SELECT CAST(id AS DECIMAL) FROM customer",
|
||||
"SELECT CAST(id AS NUMERIC) FROM customer",
|
||||
);
|
||||
|
||||
let sql = "SELECT CAST(id AS NVARCHAR(50)) FROM customer";
|
||||
let select = verified_only_select(sql);
|
||||
assert_eq!(
|
||||
&Expr::Cast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::Nvarchar(Some(50))
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue