mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-02 13:12:16 +00:00
Improve parsing performance by reducing token cloning (#1587)
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
parent
024a878ee7
commit
df3c5652b1
6 changed files with 344 additions and 244 deletions
|
@ -245,11 +245,11 @@ impl Dialect for PostgreSqlDialect {
|
|||
|
||||
pub fn parse_create(parser: &mut Parser) -> Option<Result<Statement, ParserError>> {
|
||||
let name = parser.maybe_parse(|parser| -> Result<ObjectName, ParserError> {
|
||||
parser.expect_keyword(Keyword::CREATE)?;
|
||||
parser.expect_keyword(Keyword::TYPE)?;
|
||||
parser.expect_keyword_is(Keyword::CREATE)?;
|
||||
parser.expect_keyword_is(Keyword::TYPE)?;
|
||||
let name = parser.parse_object_name(false)?;
|
||||
parser.expect_keyword(Keyword::AS)?;
|
||||
parser.expect_keyword(Keyword::ENUM)?;
|
||||
parser.expect_keyword_is(Keyword::AS)?;
|
||||
parser.expect_keyword_is(Keyword::ENUM)?;
|
||||
Ok(name)
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue