The problem is that adding several orders generates for QueryParams this: &order=last_chatted.desc&order=created_at.desc
Previous workaround:
request_build=
supabase.table("clones")
.select("*")
.eq("owner", uid)
.order("last_chatted", desc=True)
.order("created_at", desc=True)
#get list of all added orders
removed_orders=request_build.params.get_list('order')
#remove them from QueryParams
request_build.params=request_build.params.remove('order')
#add back by merging them
request_build.params=request_build.params.add('order',','.join(removed_orders))
response =request_build.execute()
Fixed the 'order' method for 'BaseSelectRequestBuilder' to support multiple sorting criteria and handle sorting on foreign tables.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Issue: https://github.com/supabase/supabase-py/issues/775
The problem is that adding several orders generates for QueryParams this:
&order=last_chatted.desc&order=created_at.desc
Previous workaround:
What is the new behavior?
Works as expected and generates QueryParams according to postgrest docs and it looks like: &order=last_chatted.desc,created_at.desc
Additional context
Add any other context or screenshots.