Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to order by multiple columns in supabase?

How can I order by publication, then by title in supabase?

This is wrong:

.order('publicationDate', { ascending: false }, 'title', { ascending: true });

If I make them separate lines, the 2nd one overrides the first.

like image 768
Mel Avatar asked Oct 23 '25 16:10

Mel


1 Answers

According to the comment in the source code of @supabase/postgres-js package the only way to order by multiple columns is by using .order method multiple times.

like image 198
fenrir Avatar answered Oct 27 '25 05:10

fenrir