Skip to content

Commit

Permalink
Add support for UPDATE FROM for SQLite (further to apache#694)
Browse files Browse the repository at this point in the history
"UPDATE-FROM is supported beginning in SQLite version 3.33.0
(2020-08-14)." from https://www.sqlite.org/lang_update.html
  • Loading branch information
ggaughan committed Jan 29, 2024
1 parent bcecd85 commit 3133bf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8048,7 +8048,7 @@ impl<'a> Parser<'a> {
self.expect_keyword(Keyword::SET)?;
let assignments = self.parse_comma_separated(Parser::parse_assignment)?;
let from = if self.parse_keyword(Keyword::FROM)
&& dialect_of!(self is GenericDialect | PostgreSqlDialect | DuckDbDialect | BigQueryDialect | SnowflakeDialect | RedshiftSqlDialect | MsSqlDialect)
&& dialect_of!(self is GenericDialect | PostgreSqlDialect | DuckDbDialect | BigQueryDialect | SnowflakeDialect | RedshiftSqlDialect | MsSqlDialect | SQLiteDialect )
{
Some(self.parse_table_and_joins()?)
} else {
Expand Down
1 change: 1 addition & 0 deletions tests/sqlparser_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ fn parse_update_set_from() {
Box::new(SnowflakeDialect {}),
Box::new(RedshiftSqlDialect {}),
Box::new(MsSqlDialect {}),
Box::new(SQLiteDialect {}),
],
options: None,
};
Expand Down

0 comments on commit 3133bf3

Please sign in to comment.