feat: Support accessing array items and fields of composite types through json operators
This is supported in select=, in filters and in order=. Resolves #1543 Resolves #2075 Signed-off-by: Wolfgang Walther <walther@technowledgy.de>
This commit is contained in:
committed by
Wolfgang Walther
parent
87bd8e72cf
commit
9f1b5c0a81
Vendored
+6
@@ -730,3 +730,9 @@ INSERT INTO test.clientinfo (id,clientid, other) values (1,1,'123 Main St'),(2,2
|
||||
|
||||
TRUNCATE TABLE test.chores CASCADE;
|
||||
INSERT INTO test.chores (id, name, done) values (1, 'take out the garbage', true), (2, 'do the laundry', false), (3, 'wash the dishes', null);
|
||||
|
||||
TRUNCATE TABLE test.fav_numbers CASCADE;
|
||||
INSERT INTO test.fav_numbers VALUES (ROW(0.5, 0.5), 'A'), (ROW(0.6, 0.6), 'B');
|
||||
|
||||
TRUNCATE TABLE test.arrays CASCADE;
|
||||
INSERT INTO test.arrays VALUES (0, '{1,2,3}', '{{1,2,3},{4,5,6},{7,8,9}}'), (1, '{11,12,13}', '{{11,12,13},{14,15,16},{17,18,19}}');
|
||||
|
||||
Vendored
+2
@@ -19,6 +19,7 @@ GRANT ALL ON TABLE
|
||||
, items3
|
||||
, "articleStars"
|
||||
, articles
|
||||
, arrays
|
||||
, auto_incrementing_pk
|
||||
, clients
|
||||
, comments
|
||||
@@ -27,6 +28,7 @@ GRANT ALL ON TABLE
|
||||
, compound_pk_view
|
||||
, deferrable_unique_constraint
|
||||
, empty_table
|
||||
, fav_numbers
|
||||
, has_count_column
|
||||
, has_fk
|
||||
, insertable_view_with_join
|
||||
|
||||
Vendored
+18
@@ -2427,3 +2427,21 @@ BEGIN
|
||||
END IF;
|
||||
END
|
||||
$do$;
|
||||
|
||||
-- https://github.com/PostgREST/postgrest/issues/1543
|
||||
CREATE TYPE complex AS (
|
||||
r double precision,
|
||||
i double precision
|
||||
);
|
||||
|
||||
CREATE TABLE test.fav_numbers (
|
||||
num complex,
|
||||
person text
|
||||
);
|
||||
|
||||
-- https://github.com/PostgREST/postgrest/issues/2075
|
||||
create table test.arrays (
|
||||
id int primary key,
|
||||
numbers int[],
|
||||
numbers_mult int[][]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user