mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-19 05:30:19 +00:00
Support USE db
(#565)
This commit is contained in:
parent
71c3ec057b
commit
a9db6ed139
4 changed files with 25 additions and 0 deletions
|
@ -177,6 +177,7 @@ impl<'a> Parser<'a> {
|
|||
Keyword::CLOSE => Ok(self.parse_close()?),
|
||||
Keyword::SET => Ok(self.parse_set()?),
|
||||
Keyword::SHOW => Ok(self.parse_show()?),
|
||||
Keyword::USE => Ok(self.parse_use()?),
|
||||
Keyword::GRANT => Ok(self.parse_grant()?),
|
||||
Keyword::REVOKE => Ok(self.parse_revoke()?),
|
||||
Keyword::START => Ok(self.parse_start_transaction()?),
|
||||
|
@ -3776,6 +3777,11 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn parse_use(&mut self) -> Result<Statement, ParserError> {
|
||||
let db_name = self.parse_identifier()?;
|
||||
Ok(Statement::Use { db_name })
|
||||
}
|
||||
|
||||
pub fn parse_table_and_joins(&mut self) -> Result<TableWithJoins, ParserError> {
|
||||
let relation = self.parse_table_factor()?;
|
||||
// Note that for keywords to be properly handled here, they need to be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue