Move unwords higher for branch parity

This commit is contained in:
Joe Nelson
2016-06-02 08:40:24 -07:00
parent 5e3d9442af
commit 7563b5e2f4
+3 -5
View File
@@ -340,11 +340,9 @@ requestToQuery schema (DbMutate (Insert mainTbl (PayloadJSON (UniformObjects row
insInto = unwords [ "INSERT INTO" , fromQi qi, insInto = unwords [ "INSERT INTO" , fromQi qi,
if T.null colsString then "" else "(" <> colsString <> ")" if T.null colsString then "" else "(" <> colsString <> ")"
] ]
vals = if T.null colsString vals = unwords $ if T.null colsString
then "DEFAULT VALUES" then ["DEFAULT VALUES"]
else unwords [ else ["SELECT", colsString, "FROM json_populate_recordset(null::" , fromQi qi, ", $1)"] in
"SELECT", colsString, "FROM json_populate_recordset(null::" , fromQi qi, ", $1)"
] in
insInto <> vals insInto <> vals
requestToQuery schema (DbMutate (Update mainTbl (PayloadJSON (UniformObjects rows)) conditions)) = requestToQuery schema (DbMutate (Update mainTbl (PayloadJSON (UniformObjects rows)) conditions)) =