带有过滤器的supabase流不适用于删除操作

发布于 2025-01-30 10:03:49 字数 592 浏览 6 评论 0原文

我有一个流从supabase中的表,插入和更新操作从表中进行更改的更改,当一个发生时,一个会更改flutter上的流并重新绘制小部件,但是如果我删除数据库中的一行或通过应用程序,则流不听。 。

这是在颤音上聆听的流守则。

    Stream<List<Map<String, dynamic>>> response = clientSupabase
    .from('PollSongs:id_pub=eq.$id')
    .stream(['id'])
    .order('likes', ascending: false)
    .execute();

我尝试不使用.from('Pollsongs')而尝试使用相同的代码,并且所有操作都可以很好地插入,更新和删除。

Stream<List<Map<String, dynamic>>> response = clientSupabase
.from('PollSongs')
.stream(['id'])
.order('likes', ascending: false)
.execute();

I have one stream listening changes from a table in supabase, insert and update operations works fine, when occurs one change the stream on flutter listen and re draw the widget but if I delete one row in the database or through the app the stream not listen.

This is the code of stream that listen on flutter.

    Stream<List<Map<String, dynamic>>> response = clientSupabase
    .from('PollSongs:id_pub=eq.$id')
    .stream(['id'])
    .order('likes', ascending: false)
    .execute();

I try without filter just using .from('PollSongs') and the same code and all operation works fine insert, update, and delete.

Stream<List<Map<String, dynamic>>> response = clientSupabase
.from('PollSongs')
.stream(['id'])
.order('likes', ascending: false)
.execute();

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无风消散 2025-02-06 10:03:49

对于不在stream()部分上记录此内容的道歉,但是您可以尝试运行以下SQL并查看是否修复了它?

alter table "PollSongs" replica identity full;

您可以在官方文档中阅读有关此配置的更多信息。
https://supabase.com/docs.com/docs/docs/docs/docs/docs/reference/reference/reference/javascript/subscript一下听力删除

Apologies for not documenting this on the stream() section, but could you try running the following SQL and see if it fixes it?

alter table "PollSongs" replica identity full;

You can read more about this configuration here in the official docs.
https://supabase.com/docs/reference/javascript/subscribe#listening-to-deletes

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文