From 3133bf3f007eaf4d398178c162974a85f89e702c Mon Sep 17 00:00:00 2001 From: Greg Gaughan Date: Mon, 29 Jan 2024 21:14:13 +0000 Subject: [PATCH] Add support for UPDATE FROM for SQLite (further to #694) "UPDATE-FROM is supported beginning in SQLite version 3.33.0 (2020-08-14)." from https://www.sqlite.org/lang_update.html --- src/parser/mod.rs | 2 +- tests/sqlparser_common.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 36ac2fd28..998d5f9bb 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -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 { diff --git a/tests/sqlparser_common.rs b/tests/sqlparser_common.rs index fcacb3459..8ceef5075 100644 --- a/tests/sqlparser_common.rs +++ b/tests/sqlparser_common.rs @@ -323,6 +323,7 @@ fn parse_update_set_from() { Box::new(SnowflakeDialect {}), Box::new(RedshiftSqlDialect {}), Box::new(MsSqlDialect {}), + Box::new(SQLiteDialect {}), ], options: None, };