Search code examples
databaseflutterdartsupabasesupabase-database

match function is giving an error in Supabase flutter


I'm trying to fetch some data from the database using the code

  Supabase.instance.client
      .from('delivery')
      .select('location')
      .match({'order': 'test'})
      .then((value){print(value);});

unfortunately it gives mt the error

PostgrestException(message: "failed to parse order (eq.test)" (line 1, column 4), code: PGRST100, details: unexpected "t" expecting "asc", "desc", "nullsfirst" or "nullslast", hint: null)
E/flutter (10564): #0      PostgrestBuilder._parseResponse (package:postgrest/src/postgrest_builder.dart:323:7)
E/flutter (10564): #1      PostgrestBuilder._execute (package:postgrest/src/postgrest_builder.dart:198:14)
E/flutter (10564): <asynchronous suspension>
E/flutter (10564): #2      PostgrestBuilder.then (package:postgrest/src/postgrest_builder.dart:400:24)
E/flutter (10564): <asynchronous suspension>
E/flutter (10564):  

any ideas how can i solve that ?

Thanks.


Solution

  • For me, the issue was fixed by renaming the 'order' column to something else, like custom_order.

    It's likely reserved for a built-in postgrest feature.