From 03111cedbf3b7f9ae529cd414bbfad3f87f8e46e Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Wed, 26 Oct 2022 20:16:06 +0200 Subject: [PATCH] refactor: Fix typo in QueryBuilder Signed-off-by: Wolfgang Walther --- src/PostgREST/Query/QueryBuilder.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PostgREST/Query/QueryBuilder.hs b/src/PostgREST/Query/QueryBuilder.hs index dc96b4fef..96701be25 100644 --- a/src/PostgREST/Query/QueryBuilder.hs +++ b/src/PostgREST/Query/QueryBuilder.hs @@ -111,7 +111,7 @@ getJoin fld node@(Node ReadPlan{relJoinType} _) = in correlatedSubquery subq aggAlias condition mutatePlanToQuery :: MutatePlan -> SQL.Snippet -mutatePlanToQuery (Insert mainQi iCols body onConflct putConditions returnings _ applyDefaults) = +mutatePlanToQuery (Insert mainQi iCols body onConflict putConditions returnings _ applyDefaults) = "INSERT INTO " <> fromQi mainQi <> (if null iCols then " " else "(" <> cols <> ") ") <> fromJsonBodyF body iCols True False applyDefaults <> -- Only used for PUT @@ -128,11 +128,11 @@ mutatePlanToQuery (Insert mainQi iCols body onConflct putConditions returnings _ if null iCols then "DO NOTHING" else "DO UPDATE SET " <> intercalateSnippet ", " ((pgFmtIdent . cfName) <> const " = EXCLUDED." <> (pgFmtIdent . cfName) <$> iCols) <> (if null putConditions && not mergeDups then mempty else "WHERE " <> addConfigPgrstInserted False) - ) onConflct <> " " <> + ) onConflict <> " " <> returningF mainQi returnings where cols = intercalateSnippet ", " $ pgFmtIdent . cfName <$> iCols - mergeDups = case onConflct of {Just (MergeDuplicates,_) -> True; _ -> False;} + mergeDups = case onConflict of {Just (MergeDuplicates,_) -> True; _ -> False;} -- An update without a limit is always filtered with a WHERE mutatePlanToQuery (Update mainQi uCols body logicForest range ordts returnings applyDefaults)