mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-13 09:26:19 +00:00
update on conflict method (#735)
This commit is contained in:
parent
a422116b89
commit
042effdf14
3 changed files with 94 additions and 18 deletions
|
@ -5351,8 +5351,16 @@ impl<'a> Parser<'a> {
|
|||
} else {
|
||||
self.expect_keyword(Keyword::UPDATE)?;
|
||||
self.expect_keyword(Keyword::SET)?;
|
||||
let l = self.parse_comma_separated(Parser::parse_assignment)?;
|
||||
OnConflictAction::DoUpdate(l)
|
||||
let assignments = self.parse_comma_separated(Parser::parse_assignment)?;
|
||||
let selection = if self.parse_keyword(Keyword::WHERE) {
|
||||
Some(self.parse_expr()?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
OnConflictAction::DoUpdate(DoUpdate {
|
||||
assignments,
|
||||
selection,
|
||||
})
|
||||
};
|
||||
|
||||
Some(OnInsert::OnConflict(OnConflict {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue