I have a supabase table with a column of boolean type, whenever I change the value to TRUE or FALSE, the rows get rearranged automatically putting rows with set to TRUE at the top.
I want rows to be in the same order as they were.
I have a supabase table with a column of boolean type, whenever I change the value to TRUE or FALSE, the rows get rearranged automatically putting rows with set to TRUE at the top.
I want rows to be in the same order as they were.
By default, Postgres does not have any specific order at which they return the rows. You can sort your table by a certain column by clicking on the Sort
button and specifying the column.
If you want to sort the data that you query from your front end app, you have to add order()
clause to sort your result:
const {data, error} = await supabase
.from('posts')
.select()
.order('created_at')