mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-02 21:22:15 +00:00
feat: Support double quoted string (#530)
This commit is contained in:
parent
f29ce10a1a
commit
17c238bda7
4 changed files with 52 additions and 7 deletions
|
@ -18,6 +18,21 @@ use test_utils::*;
|
|||
use sqlparser::ast::*;
|
||||
use sqlparser::dialect::BigQueryDialect;
|
||||
|
||||
#[test]
|
||||
fn parse_literal_string() {
|
||||
let sql = r#"SELECT 'single', "double""#;
|
||||
let select = bigquery().verified_only_select(sql);
|
||||
assert_eq!(2, select.projection.len());
|
||||
assert_eq!(
|
||||
&Expr::Value(Value::SingleQuotedString("single".to_string())),
|
||||
expr_from_projection(&select.projection[0])
|
||||
);
|
||||
assert_eq!(
|
||||
&Expr::Value(Value::DoubleQuotedString("double".to_string())),
|
||||
expr_from_projection(&select.projection[1])
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_table_identifiers() {
|
||||
fn test_table_ident(ident: &str, expected: Vec<Ident>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue