mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-23 15:34:09 +00:00
Remove PostgreSQL version of assert (#229)
Remove PostgreSQL procedural assert statement. This also simplifies code somewhat.
This commit is contained in:
parent
c24b0e01db
commit
583f22b929
3 changed files with 6 additions and 22 deletions
|
@ -182,19 +182,13 @@ impl Parser {
|
|||
}
|
||||
pub fn parse_assert(&mut self) -> Result<Statement, ParserError> {
|
||||
let condition = self.parse_expr()?;
|
||||
let (separator, message) = if self.consume_token(&Token::Comma) {
|
||||
(",".to_string(), Some(self.parse_expr()?))
|
||||
} else if self.parse_keyword(Keyword::AS) {
|
||||
("AS".to_string(), Some(self.parse_expr()?))
|
||||
let message = if self.parse_keyword(Keyword::AS) {
|
||||
Some(self.parse_expr()?)
|
||||
} else {
|
||||
("".to_string(), None)
|
||||
None
|
||||
};
|
||||
|
||||
Ok(Statement::Assert {
|
||||
condition,
|
||||
separator,
|
||||
message,
|
||||
})
|
||||
Ok(Statement::Assert { condition, message })
|
||||
}
|
||||
|
||||
/// Parse an expression prefix
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue