mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-28 22:12:24 +00:00
added ability to parse extension to parse_comment inside postgres dialect (#1451)
This commit is contained in:
parent
e849f7f143
commit
8ccb87a835
3 changed files with 21 additions and 0 deletions
|
|
@ -1855,6 +1855,7 @@ impl fmt::Display for ShowCreateObject {
|
|||
pub enum CommentObject {
|
||||
Column,
|
||||
Table,
|
||||
Extension,
|
||||
}
|
||||
|
||||
impl fmt::Display for CommentObject {
|
||||
|
|
@ -1862,6 +1863,7 @@ impl fmt::Display for CommentObject {
|
|||
match self {
|
||||
CommentObject::Column => f.write_str("COLUMN"),
|
||||
CommentObject::Table => f.write_str("TABLE"),
|
||||
CommentObject::Extension => f.write_str("EXTENSION"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,6 +205,10 @@ pub fn parse_comment(parser: &mut Parser) -> Result<Statement, ParserError> {
|
|||
let object_name = parser.parse_object_name(false)?;
|
||||
(CommentObject::Table, object_name)
|
||||
}
|
||||
Token::Word(w) if w.keyword == Keyword::EXTENSION => {
|
||||
let object_name = parser.parse_object_name(false)?;
|
||||
(CommentObject::Extension, object_name)
|
||||
}
|
||||
_ => parser.expected("comment object_type", token)?,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue