fix: arrow filter on RPC returning TABLE+composite

This commit is contained in:
steve-chavez
2023-09-28 20:26:38 -03:00
committed by Steve Chavez
parent 290d90609b
commit cf7ee67dfe
4 changed files with 30 additions and 15 deletions
@@ -300,3 +300,11 @@ spec actualPgVersion = describe "json and jsonb operators" $ do
"code": "PGRST100",
"hint": null} |]
{ matchStatus = 400, matchHeaders = [matchContentTypeJson] }
it "works when an RPC returns a dynamic TABLE with a composite type" $
get "/rpc/returns_complex?select=val->r&val->i=gt.0.5&order=val->>i.desc" `shouldRespondWith`
[json|[
{"r":0.3},
{"r":0.2}
]|]
{ matchStatus = 200, matchHeaders = [matchContentTypeJson] }
+9
View File
@@ -3447,3 +3447,12 @@ create table table_b (
table_a_id int references table_a(id),
name text
);
create or replace function test.returns_complex()
returns table(id int, val complex) as $$
select 1, row(0.1, 0.5)::complex as val
union
select 2, row(0.2, 0.6)::complex as val
union
select 3, row(0.3, 0.7)::complex as val;
$$ language sql;