mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-09 21:42:05 +00:00
Add support for PRINT
statement for SQL Server (#1811)
This commit is contained in:
parent
81d8909e00
commit
4a487290ce
5 changed files with 47 additions and 1 deletions
|
@ -617,6 +617,7 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
// `COMMENT` is snowflake specific https://docs.snowflake.com/en/sql-reference/sql/comment
|
||||
Keyword::COMMENT if self.dialect.supports_comment_on() => self.parse_comment(),
|
||||
Keyword::PRINT => self.parse_print(),
|
||||
_ => self.expected("an SQL statement", next_token),
|
||||
},
|
||||
Token::LParen => {
|
||||
|
@ -15056,6 +15057,13 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Parse [Statement::Print]
|
||||
fn parse_print(&mut self) -> Result<Statement, ParserError> {
|
||||
Ok(Statement::Print(PrintStatement {
|
||||
message: Box::new(self.parse_expr()?),
|
||||
}))
|
||||
}
|
||||
|
||||
/// Consume the parser and return its underlying token buffer
|
||||
pub fn into_tokens(self) -> Vec<TokenWithSpan> {
|
||||
self.tokens
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue