You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/spec/Feature/Query/AggregateFunctionsSpec.hs
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -154,24 +154,24 @@ allowed =
154
154
[json|[{"total_budget": 9501.06}]|]
155
155
{ matchHeaders = [matchContentTypeJson] }
156
156
it "supports aggregates from a spread relationships grouped by spreaded fields from other relationships"$do
157
-
get "/processes?select=...process_costs(cost.sum()),...process_categories(name)"`shouldRespondWith`
157
+
get "/processes?select=...process_costs(cost.sum()),...process_categories(name)&order=process_categories(name)"`shouldRespondWith`
158
158
[json|[
159
159
{"sum": 400.00, "name": "Batch"},
160
160
{"sum": 350.00, "name": "Mass"}]|]
161
161
{ matchHeaders = [matchContentTypeJson] }
162
-
get "/processes?select=...process_costs(cost_sum:cost.sum()),...process_categories(category:name)"`shouldRespondWith`
162
+
get "/processes?select=...process_costs(cost_sum:cost.sum()),...process_categories(category:name)&order=process_categories(category)"`shouldRespondWith`
163
163
[json|[
164
164
{"cost_sum": 400.00, "category": "Batch"},
165
165
{"cost_sum": 350.00, "category": "Mass"}]|]
166
166
{ matchHeaders = [matchContentTypeJson] }
167
167
it "supports aggregates on spreaded fields from nested relationships"$do
168
-
get "/process_supervisor?select=...processes(factory_id,...process_costs(cost.sum()))"`shouldRespondWith`
168
+
get "/process_supervisor?select=...processes(factory_id,...process_costs(cost.sum()))&order=processes(factory_id).desc"`shouldRespondWith`
169
169
[json|[
170
170
{"factory_id": 3, "sum": 110.00},
171
171
{"factory_id": 2, "sum": 500.00},
172
172
{"factory_id": 1, "sum": 350.00}]|]
173
173
{ matchHeaders = [matchContentTypeJson] }
174
-
get "/process_supervisor?select=...processes(factory_id,...process_costs(cost_sum:cost.sum()))"`shouldRespondWith`
174
+
get "/process_supervisor?select=...processes(factory_id,...process_costs(cost_sum:cost.sum()))&order=processes(factory_id).desc"`shouldRespondWith`
get "/message?select=id,body,sender:person_detail!message_sender_fkey(name,sent),recipient:person_detail!message_recipient_fkey(name,received)&id=lt.4"`shouldRespondWith`
239
+
get "/message?select=id,body,sender:person_detail!message_sender_fkey(name,sent),recipient:person_detail!message_recipient_fkey(name,received)&id=lt.4&order=id"`shouldRespondWith`
Copy file name to clipboardExpand all lines: test/spec/Feature/Query/QuerySpec.hs
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -692,13 +692,13 @@ spec = do
692
692
{ matchHeaders = [matchContentTypeJson] }
693
693
694
694
it "requesting data using many<->many relation defined by composite keys"$
695
-
get "/users_tasks?user_id=eq.1&task_id=eq.1&select=user_id,files(filename,content)"`shouldRespondWith`
696
-
[json|[{"user_id":1,"files":[{"filename":"autoexec.bat","content":"@ECHO OFF"},{"filename":"command.com","content":"#include <unix.h>"},{"filename":"README.md","content":"# make $$$!"}]}]|]
695
+
get "/users_tasks?user_id=eq.1&task_id=eq.1&select=user_id,files(filename,content)&files.order=filename"`shouldRespondWith`
696
+
[json|[{"user_id":1,"files":[{"filename":"README.md","content":"# make $$$!"},{"filename":"autoexec.bat","content":"@ECHO OFF"},{"filename":"command.com","content":"#include <unix.h>"}]}]|]
697
697
{ matchHeaders = [matchContentTypeJson] }
698
698
699
699
it "requesting data using many<->many (composite keys) relation using hint"$
700
-
get "/users_tasks?user_id=eq.1&task_id=eq.1&select=user_id,files!touched_files(filename,content)"`shouldRespondWith`
701
-
[json|[{"user_id":1,"files":[{"filename":"autoexec.bat","content":"@ECHO OFF"},{"filename":"command.com","content":"#include <unix.h>"},{"filename":"README.md","content":"# make $$$!"}]}]|]
700
+
get "/users_tasks?user_id=eq.1&task_id=eq.1&select=user_id,files!touched_files(filename,content)&files.order=filename"`shouldRespondWith`
701
+
[json|[{"user_id":1,"files":[{"filename":"README.md","content":"# make $$$!"},{"filename":"autoexec.bat","content":"@ECHO OFF"},{"filename":"command.com","content":"#include <unix.h>"}]}]|]
702
702
{ matchHeaders = [matchContentTypeJson] }
703
703
704
704
it "requesting children with composite key"$
@@ -1607,11 +1607,11 @@ spec = do
1607
1607
] |]
1608
1608
{ matchHeaders = [matchContentTypeJson] }
1609
1609
it "formats through join"$
1610
-
get "/datarep_next_two_todos?select=id,name,first_item:datarep_todos!datarep_next_two_todos_first_item_id_fkey(label_color,due_at)"`shouldRespondWith`
1610
+
get "/datarep_next_two_todos?select=id,name,first_item:datarep_todos!datarep_next_two_todos_first_item_id_fkey(label_color,due_at)&order=id"`shouldRespondWith`
1611
1611
[json| [{"id":1,"name":"school related","first_item":{"label_color":"#000100","due_at":"2018-01-03T00:00:00Z"}},{"id":2,"name":"do these first","first_item":{"label_color":"#000000","due_at":"2018-01-02T00:00:00Z"}}] |]
1612
1612
{ matchHeaders = [matchContentTypeJson] }
1613
1613
it "formats through join with star select"$
1614
-
get "/datarep_next_two_todos?select=id,name,second_item:datarep_todos!datarep_next_two_todos_second_item_id_fkey(*)"`shouldRespondWith`
1614
+
get "/datarep_next_two_todos?select=id,name,second_item:datarep_todos!datarep_next_two_todos_second_item_id_fkey(*)&order=id"`shouldRespondWith`
{"id":2,"name":"do these first","second_item":{"id":3,"name":"Algebra","label_color":"#01E240","due_at":"2018-01-01T14:12:34.123456Z","icon_image":null,"created_at":1513213350,"budget":"0.00"}}
@@ -1645,7 +1645,7 @@ spec = do
1645
1645
] |]
1646
1646
{ matchHeaders = [matchContentTypeJson] }
1647
1647
it "uses text parser on value for filter across relations"$
1648
-
get "/datarep_next_two_todos?select=id,name,datarep_todos!datarep_next_two_todos_first_item_id_fkey(label_color,due_at)&datarep_todos.label_color=neq.000100"`shouldRespondWith`
1648
+
get "/datarep_next_two_todos?select=id,name,datarep_todos!datarep_next_two_todos_first_item_id_fkey(label_color,due_at)&datarep_todos.label_color=neq.000100&order=id"`shouldRespondWith`
1649
1649
[json| [{"id":1,"name":"school related","datarep_todos":null},{"id":2,"name":"do these first","datarep_todos":{"label_color":"#000000","due_at":"2018-01-02T00:00:00Z"}}] |]
1650
1650
{ matchHeaders = [matchContentTypeJson] }
1651
1651
-- This is not supported by data reps (would be hard to make it work with high performance). So the test just
0 commit comments