3

I need to add order in supabase result while calling the supabase bash in postman.

I am doing same in flutter like below

Future getPropertiesFromBirmingham() async {
    var response = await client
        .from('properties')
        .limit(10)
        .order('created_at', ascending: false);

    return response;
  }

Need to use same in postman but not getting anything on this.

I didn't find much on this topic, Tried using order in params but it didn't work.

Christian Baumann
  • 3,188
  • 3
  • 20
  • 37

1 Answers1

3

You can get examples of cURL requests directly in Supabase API docs. You can also check for more documentation directly in the PostgREST website.

curl 'https://supabase_project_ref.supabase.co/rest/v1/properties?limit=10&order=created_at.desc' \
-H "apikey: SUPABASE_KEY" \
-H "Authorization: Bearer SUPABASE_KEY"

You can also control where the NULLs will be (if any) by adding either of the following:

  • nullslast
  • nullsfirst
curl 'https://supabase_project_ref.supabase.co/rest/v1/properties?order=created_at.desc.nullslast' \
-H "apikey: SUPABASE_KEY" \
-H "Authorization: Bearer SUPABASE_KEY"
Mansueli
  • 6,223
  • 8
  • 33
  • 57