WELCOME π friends to this new blog post. In this blog post, you will learn how to fetch data or get alerted whenever a row is inserted, updated, and deleted in the supabase Postgres database with the help of a supabase subscription, πPretty easy to setup.
π€When to use it?
Suppose, I gave you a project of making a real-time chat app with supabase. Then you need to fetch data whenever a new chat is inserted, deleted, or updated.
First, you need to go to the supabase database settings:
**Note: **I have selected my tables, the table settings would be different from yours.
πNote: The tables which are enabled by clicking the green button will be able to make real-time data fetching.
**on π **can have three 4 types:
INSERT β Listening to the table if any new row is inserted
UPDATEβ Listening to table if any row is updated
DELETEβ Listening to table if any row is deleted
- β Listening to the table for all the above changes.
you will get a response something like this:
For People who understand Hindi: https://youtu.be/ECIfs9bb7OA
Thanks for reading, if any error comes, feel free to ask here π:
Join the Next Dev's server Discord Server!
Top comments (0)