Flutter中Supabase的match函数查询报错求助
问题解决方法
错误原因
order 是PostgREST的保留关键字,直接将其作为字段名进行匹配查询时,会被系统误识别为排序指令,从而引发解析错误。
解决方案
通过双引号包裹字段名的方式,明确告诉PostgREST这是一个列名而非关键字,以下两种写法都可行:
方法一:使用match方法时转义字段名
Supabase.instance.client .from('delivery') .select('location') .match({'"order"': 'test'}) .then((value){print(value);});
方法二:使用eq方法直接指定条件
Supabase.instance.client .from('delivery') .select('location') .eq('"order"', 'test') .then((value){print(value);});
内容的提问来源于stack exchange,提问作者mohammadmnyer
相关产品推荐
相关产品推荐

