mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-20 14:10:15 +00:00
add support for SAVEPOINT statement (#438)
This commit is contained in:
parent
497a3b0e1b
commit
12a3e97ef3
3 changed files with 22 additions and 0 deletions
|
@ -179,6 +179,7 @@ impl<'a> Parser<'a> {
|
|||
// standard `START TRANSACTION` statement. It is supported
|
||||
// by at least PostgreSQL and MySQL.
|
||||
Keyword::BEGIN => Ok(self.parse_begin()?),
|
||||
Keyword::SAVEPOINT => Ok(self.parse_savepoint()?),
|
||||
Keyword::COMMIT => Ok(self.parse_commit()?),
|
||||
Keyword::ROLLBACK => Ok(self.parse_rollback()?),
|
||||
Keyword::ASSERT => Ok(self.parse_assert()?),
|
||||
|
@ -367,6 +368,11 @@ impl<'a> Parser<'a> {
|
|||
Ok(Statement::Assert { condition, message })
|
||||
}
|
||||
|
||||
pub fn parse_savepoint(&mut self) -> Result<Statement, ParserError> {
|
||||
let name = self.parse_identifier()?;
|
||||
Ok(Statement::Savepoint { name })
|
||||
}
|
||||
|
||||
/// Parse an expression prefix
|
||||
pub fn parse_prefix(&mut self) -> Result<Expr, ParserError> {
|
||||
// PostgreSQL allows any string literal to be preceded by a type name, indicating that the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue