From 9053bd8857e183fc20d9c74a1c8e9f596d42034e Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Wed, 18 May 2022 12:51:46 +0200 Subject: [PATCH] [jOOQ/jOOQ#7912] Support parsing SET ALL TO EXCLUDED --- jOOQ/src/main/java/org/jooq/impl/ParserImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java index 14df8c160c..4c090b4164 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java @@ -2303,7 +2303,9 @@ final class DefaultParseContext extends AbstractScope implements ParseContext { if (parseKeywordIf("DUPLICATE KEY UPDATE")) { parseKeywordIf("SET"); - InsertOnConflictWhereStep where = onDuplicate.onDuplicateKeyUpdate().set(parseSetClauseList()); + InsertOnConflictWhereStep where = parseKeywordIf("ALL TO EXCLUDED") + ? onDuplicate.onDuplicateKeyUpdate().setAllToExcluded() + : onDuplicate.onDuplicateKeyUpdate().set(parseSetClauseList()); if (parseKeywordIf("WHERE")) returning = where.where(parseCondition()); @@ -2336,7 +2338,9 @@ final class DefaultParseContext extends AbstractScope implements ParseContext { returning = doUpdate.doNothing(); } else if (parseKeywordIf("UPDATE SET")) { - InsertOnConflictWhereStep where = doUpdate.doUpdate().set(parseSetClauseList()); + InsertOnConflictWhereStep where = parseKeywordIf("ALL TO EXCLUDED") + ? doUpdate.doUpdate().setAllToExcluded() + : doUpdate.doUpdate().set(parseSetClauseList()); if (parseKeywordIf("WHERE")) returning = where.where(parseCondition());