correct missing=default with GENERATED BY column

This commit is contained in:
steve-chavez
2023-04-14 22:12:34 -05:00
committed by Steve Chavez
parent 0a2b7064c7
commit 3e53796120
4 changed files with 42 additions and 1 deletions
+10
View File
@@ -495,6 +495,16 @@ spec actualPgVersion = do
, matchHeaders = ["Preference-Applied" <:> "missing=default"]
}
when (actualPgVersion >= pgVersion100) $
it "inserts a default on a generated by default as identity column" $ do
request methodPost "/channels?columns=id,data,slug&select=data,slug" [("Prefer", "return=representation"), ("Prefer", "missing=default")]
[json| { "slug": "foo" } |]
`shouldRespondWith`
[json| [{"data":{"foo": "bar"},"slug":"foo"}] |] -- id 1 was inserted here, we don't get it for idempotence in the tests
{ matchStatus = 201
, matchHeaders = ["Preference-Applied" <:> "missing=default"]
}
it "inserts json that has duplicate keys" $ do
request methodPost "/tbl_w_json" [("Prefer", "return=representation")]
[json| { "data": { "a": 1, "a": 2 }, "id": 3 } |]