Uses anti_id computed column to make test case clearer
This commit is contained in:
@@ -134,7 +134,7 @@ spec =
|
|||||||
[json| [{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":6},{"id":7},{"id":8},{"id":9},{"id":10},{"id":11},{"id":12},{"id":13},{"id":14},{"id":15}] |]
|
[json| [{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":6},{"id":7},{"id":8},{"id":9},{"id":10},{"id":11},{"id":12},{"id":13},{"id":14},{"id":15}] |]
|
||||||
|
|
||||||
it "order by computed column" $
|
it "order by computed column" $
|
||||||
get "/items?order=always_true.asc,id.asc" `shouldRespondWith`
|
get "/items?order=anti_id.desc" `shouldRespondWith`
|
||||||
[json| [{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":6},{"id":7},{"id":8},{"id":9},{"id":10},{"id":11},{"id":12},{"id":13},{"id":14},{"id":15}] |]
|
[json| [{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":6},{"id":7},{"id":8},{"id":9},{"id":10},{"id":11},{"id":12},{"id":13},{"id":14},{"id":15}] |]
|
||||||
|
|
||||||
it "matches filtering nested items" $
|
it "matches filtering nested items" $
|
||||||
|
|||||||
Vendored
+5
@@ -462,6 +462,11 @@ CREATE FUNCTION public.always_true(test.items) RETURNS boolean
|
|||||||
|
|
||||||
ALTER FUNCTION public.always_true(test.items) OWNER TO postgrest_test;
|
ALTER FUNCTION public.always_true(test.items) OWNER TO postgrest_test;
|
||||||
|
|
||||||
|
CREATE FUNCTION public.anti_id(test.items) RETURNS bigint
|
||||||
|
LANGUAGE sql STABLE
|
||||||
|
AS $$ SELECT $1.id * -1 $$;
|
||||||
|
|
||||||
|
ALTER FUNCTION public.anti_id(test.items) OWNER TO postgrest_test;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE ONLY authors_only
|
ALTER TABLE ONLY authors_only
|
||||||
|
|||||||
Reference in New Issue
Block a user