How to subscribe to real-time changes on your database - SupabaseTips

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
real-time features are essential part of building reactive applications but it can be challenging to build it all by yourself luckily super bass makes it easy to subscribe to real-time changes happening on your database let's take a look at how we can do that on your client-side application with the Super Bass SDK installed create a channel and add a callback using the on method within on specify that we are listening to postgres changes give it an event schema table and add a callback lastly we subscribe to it and we are ready to receive database changes on the client side it then takes four different values insert update delete or answers for all in order to start receiving these changes though we also need to set some configuration on our Super Bass dashboard as well real-time feature can be enabled on a per table basis to enroll a table in real time you can go to database replication find the super based real-time publication and enable it for the table that you want to get notified for let's go back to the code and with the setup on our dashboard completed we can subscribe to real-time changes on our client payload contains information about the event event type contains whether the event was on the insert update or delete new contains the new record after the event old contains the primary key of the old record by default you can set the replica identity to follow in order to receive all columns and not just the primary key for update events there are some filters available to further control which roads to get notified for at the time of this recording there are 7 supported filters but our real-time team is always working towards supporting more EQ for roles where the column equals a certain value any queue for roles where the column does not equal a certain value LT for roles where the column is less than a value LTE for rows where the column is less than or equal to a value GT for rows where the column is greater than a value GTE for rows where the column is greater than or equal to a value in in for rows where the column is in one of the values specified and with that you can easily subscribe to real-time changes on your Super Bass database from your application head to superbass.com to learn more about our real-time features and much much more about Super Bass [Music]
Info
Channel: Supabase
Views: 8,354
Rating: undefined out of 5
Keywords:
Id: 2rUjcmgZDwQ
Channel Id: undefined
Length: 2min 17sec (137 seconds)
Published: Mon Mar 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.