mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-19 05:30:19 +00:00
feat: Support CLOSE (cursors) (#515)
This commit is contained in:
parent
3f1c6426f0
commit
d361c3a3a1
3 changed files with 61 additions and 0 deletions
|
@ -174,6 +174,7 @@ impl<'a> Parser<'a> {
|
|||
Keyword::UPDATE => Ok(self.parse_update()?),
|
||||
Keyword::ALTER => Ok(self.parse_alter()?),
|
||||
Keyword::COPY => Ok(self.parse_copy()?),
|
||||
Keyword::CLOSE => Ok(self.parse_close()?),
|
||||
Keyword::SET => Ok(self.parse_set()?),
|
||||
Keyword::SHOW => Ok(self.parse_show()?),
|
||||
Keyword::GRANT => Ok(self.parse_grant()?),
|
||||
|
@ -2563,6 +2564,18 @@ impl<'a> Parser<'a> {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn parse_close(&mut self) -> Result<Statement, ParserError> {
|
||||
let cursor = if self.parse_keyword(Keyword::ALL) {
|
||||
CloseCursor::All
|
||||
} else {
|
||||
let name = self.parse_identifier()?;
|
||||
|
||||
CloseCursor::Specific { name }
|
||||
};
|
||||
|
||||
Ok(Statement::Close { cursor })
|
||||
}
|
||||
|
||||
fn parse_copy_option(&mut self) -> Result<CopyOption, ParserError> {
|
||||
let ret = match self.parse_one_of_keywords(&[
|
||||
Keyword::FORMAT,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue