Allow PATCH/DELETE w/o Prefer when no SELECT privs
PATCH/DELETE can now be done without adding Prefer return=minimal when the user doesn't have SELECT privileges. * Also fix PATCH wrong HTTP status code
This commit is contained in:
committed by
Steve Chávez
parent
337f821e00
commit
ed2bfc09a6
@@ -191,3 +191,9 @@ countF countQuery shouldCount =
|
||||
else (
|
||||
mempty
|
||||
, "null::bigint")
|
||||
|
||||
returningF :: QualifiedIdentifier -> [FieldName] -> SqlFragment
|
||||
returningF qi returnings =
|
||||
if null returnings
|
||||
then "RETURNING 1" -- For mutation cases where there's no ?select, we return 1 to know how many rows were modified
|
||||
else "RETURNING " <> intercalate ", " (pgFmtColumn qi <$> returnings)
|
||||
|
||||
Reference in New Issue
Block a user