mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +00:00
Simplify parse_create() a little
Don't need the duplicate `columns.push()` + we advance the tokenizer, so no need to peek first.
This commit is contained in:
parent
89602dc044
commit
a0f625b949
1 changed files with 10 additions and 21 deletions
|
@ -571,28 +571,17 @@ impl Parser {
|
|||
};
|
||||
debug!("default: {:?}", default);
|
||||
|
||||
match self.peek_token() {
|
||||
Some(Token::Comma) => {
|
||||
self.next_token();
|
||||
columns.push(SQLColumnDef {
|
||||
name: column_name.as_sql_ident(),
|
||||
data_type: data_type,
|
||||
allow_null,
|
||||
is_primary,
|
||||
is_unique,
|
||||
default,
|
||||
});
|
||||
}
|
||||
columns.push(SQLColumnDef {
|
||||
name: column_name.as_sql_ident(),
|
||||
data_type: data_type,
|
||||
allow_null,
|
||||
is_primary,
|
||||
is_unique,
|
||||
default,
|
||||
});
|
||||
match self.next_token() {
|
||||
Some(Token::Comma) => {}
|
||||
Some(Token::RParen) => {
|
||||
self.next_token();
|
||||
columns.push(SQLColumnDef {
|
||||
name: column_name.as_sql_ident(),
|
||||
data_type: data_type,
|
||||
allow_null,
|
||||
is_primary,
|
||||
is_unique,
|
||||
default,
|
||||
});
|
||||
break;
|
||||
}
|
||||
other => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue