Fix UPSERT bug on camelCase PK column

This commit is contained in:
steve-chavez
2018-05-31 11:57:42 -05:00
committed by Steve Chávez
parent 9ea7529f30
commit 37e7398a85
6 changed files with 39 additions and 1 deletions
+1 -1
View File
@@ -288,7 +288,7 @@ requestToQuery schema _ (DbMutate (Insert mainTbl pkCols p@(PayloadJSON _ pType
-- Only used for PUT
("WHERE " <> intercalate " AND " (pgFmtLogicTree (QualifiedIdentifier "" "_") <$> logicForest)) `emptyOnFalse` null logicForest],
maybe "" (\x -> (
"ON CONFLICT(" <> intercalate ", " pkCols <> ") " <> case x of
"ON CONFLICT(" <> intercalate ", " (pgFmtIdent <$> pkCols) <> ") " <> case x of
IgnoreDuplicates ->
"DO NOTHING"
MergeDuplicates ->