mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-19 05:30:19 +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
|
@ -504,6 +504,7 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
Token::Number(_, _)
|
||||
| Token::SingleQuotedString(_)
|
||||
| Token::DoubleQuotedString(_)
|
||||
| Token::NationalStringLiteral(_)
|
||||
| Token::HexStringLiteral(_) => {
|
||||
self.prev_token();
|
||||
|
@ -2773,6 +2774,7 @@ impl<'a> Parser<'a> {
|
|||
Err(e) => parser_err!(format!("Could not parse '{}' as number: {}", n, e)),
|
||||
},
|
||||
Token::SingleQuotedString(ref s) => Ok(Value::SingleQuotedString(s.to_string())),
|
||||
Token::DoubleQuotedString(ref s) => Ok(Value::DoubleQuotedString(s.to_string())),
|
||||
Token::NationalStringLiteral(ref s) => Ok(Value::NationalStringLiteral(s.to_string())),
|
||||
Token::EscapedStringLiteral(ref s) => Ok(Value::EscapedStringLiteral(s.to_string())),
|
||||
Token::HexStringLiteral(ref s) => Ok(Value::HexStringLiteral(s.to_string())),
|
||||
|
@ -2807,6 +2809,7 @@ impl<'a> Parser<'a> {
|
|||
match self.next_token() {
|
||||
Token::Word(Word { value, keyword, .. }) if keyword == Keyword::NoKeyword => Ok(value),
|
||||
Token::SingleQuotedString(s) => Ok(s),
|
||||
Token::DoubleQuotedString(s) => Ok(s),
|
||||
Token::EscapedStringLiteral(s) if dialect_of!(self is PostgreSqlDialect | GenericDialect) => {
|
||||
Ok(s)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue