gpt4 book ai didi

Query to select a row of table returns null and undefined(选择一行表格的查询返回NULL和UNDEFINED)

转载 作者:bug小助手 更新时间:2023-10-25 20:36:52 34 4
gpt4 key购买 nike



I have a react app which uses supabase as its database.

this is my table:
enter image description here

I have set the RLS policies to read and update for all users.

In the other hand, this is my react app codes:

Query function:

enter image description here

Custom hook:

enter image description here

and my functional component:

enter image description here

But i get this error:

enter image description here

我有一个反应应用程序,使用超级数据库作为其数据库。这是我的表:我已经将所有用户的RLS策略设置为读取和更新。另一方面,这是我的反应应用程序代码:Query Function:Custom Hook:和我的功能组件:但我收到以下错误:


I tried to select and get my table's single row, but i got null or undefined.

我试图选择并获取我的表的单行,但得到的结果为空或未定义。


更多回答

Please don't use screenshots for code examples, paste them directly here with the correct formatting. You didn't show what any of your RLS policies look like, have you tested this with RLS turned off? to be sure that the issue is RLS related. If it works with RLS turned off then it's your policy not being met or your user isn't logged in.

请不要在代码示例中使用屏幕截图,请直接将它们以正确的格式粘贴到此处。您没有显示您的任何RLS策略是什么样子的,您是否在关闭RLS的情况下进行了测试?以确保该问题与RLS相关。如果它在关闭RLS的情况下工作,则表明您的策略未得到满足或您的用户未登录。

优秀答案推荐
更多回答

34 4 0