Quote identifier names in RPC function arguments (#1153)
This commit is contained in:
@@ -78,6 +78,16 @@ spec =
|
||||
get "/rpc/sayhello" `shouldRespondWith` 404
|
||||
get "/rpc/sayhello?any_arg=value" `shouldRespondWith` 404
|
||||
|
||||
it "works when having uppercase identifiers" $ do
|
||||
get "/rpc/quotedFunction?user=mscott&fullName=Michael Scott&SSN=401-32-XXXX" `shouldRespondWith`
|
||||
[json|{"user": "mscott", "fullName": "Michael Scott", "SSN": "401-32-XXXX"}|]
|
||||
{ matchHeaders = [matchContentTypeJson] }
|
||||
post "/rpc/quotedFunction"
|
||||
[json|{"user": "dschrute", "fullName": "Dwight Schrute", "SSN": "030-18-XXXX"}|]
|
||||
`shouldRespondWith`
|
||||
[json|{"user": "dschrute", "fullName": "Dwight Schrute", "SSN": "030-18-XXXX"}|]
|
||||
{ matchHeaders = [matchContentTypeJson] }
|
||||
|
||||
context "shaping the response returned by a proc" $ do
|
||||
it "returns a project" $ do
|
||||
post "/rpc/getproject" [json| { "id": 1} |] `shouldRespondWith`
|
||||
|
||||
Vendored
+5
@@ -1570,3 +1570,8 @@ comment on materialized view materialized_projects is
|
||||
$$A materialized view for projects
|
||||
|
||||
Just a test for materialized views$$;
|
||||
|
||||
create or replace function test."quotedFunction"("user" text, "fullName" text, "SSN" text)
|
||||
returns jsonb AS $$
|
||||
select format('{"user": "%s", "fullName": "%s", "SSN": "%s"}', "user", "fullName", "SSN")::jsonb;
|
||||
$$ language sql;
|
||||
|
||||
Reference in New Issue
Block a user