# Supabase Joins + Realtime

**URL:** <https://community.weweb.io/t/supabase-joins-realtime/8989>\
**Category:** Ask us anything\
**Tags:** supabase\
**Created:** [June 6, 2024, 8:39pm UTC](https://community.weweb.io/t/supabase-joins-realtime/8989 "2024-06-06T20:39:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kawwl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kawwl/32/14297_2.png) [@Kawwl](https://community.weweb.io/u/Kawwl)\
**Post date:** [June 6, 2024, 8:39pm UTC](https://community.weweb.io/t/supabase-joins-realtime/8989/1 "2024-06-06T20:39:05Z")

</div>

Hi,

I’m having an activity log table which uses JOINS to work. Sadly, I don’t get all data from the joins, which makes it a bit cumbersome. I can probably redesign the database a bit to avoid joins, but I’d rather not if possible.

Is there possibility to make this work with Supabase, and if yes, are there any plans to implement this into WeWeb?

Thanks!

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 6, 2024, 9:01pm UTC](https://community.weweb.io/t/supabase-joins-realtime/8989/2 "2024-06-06T21:01:57Z")

</div>

For now you have only one option I think, doing it yourself. Either by code, or by hacking it with the WeWeb’s resources a little bit. I think this can be done, at the very least the code way definitely. I usually do a Proof of Concept with people on my 1:1 meets if you’d be interested in that 👍

I think one approach would be using a WeWeb’s component and the fact that you can listen to changes of a variable. The other option might lie in creating a formula, which by definiton is reactive. And the last option is straight code. I’ve successfully bent realtime some while back, but it requires quite some time to make this happen, as WeWeb currently doesn’t offer that kind of thing out of the box.

By the way, editing the db a lot to match realtime might not be the right approach, as it might cause issues with the [Normalization rules.](https://www.studytonight.com/dbms/database-normalization.php)

---

<div class="post-metadata">

**Author:** ![Kawwl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kawwl/32/14297_2.png) [@Kawwl](https://community.weweb.io/u/Kawwl)\
**Post date:** [June 6, 2024, 9:24pm UTC](https://community.weweb.io/t/supabase-joins-realtime/8989/3 "2024-06-06T21:24:25Z")

</div>

Was afraid so.

Well, I implemented the listen for change and trigger the fetch. The weird thing is that it worked even though i didn’t bind my listener to anything yet on this page. Strange?

![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/4ccd4df96a33f33424a780acaa266a5eedec2ed7.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/865c3162527fd997e5b44b264afe7e6069732879.png)

I’ll have to dig. But, for now this should work fine. I’m limiting data fetch, so hopefully not a really huge thing.

Thanks again, Broberto

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 6, 2024, 9:45pm UTC](https://community.weweb.io/t/supabase-joins-realtime/8989/4 "2024-06-06T21:45:07Z")

</div>

> [@Kawwl](#):
>
> I’ll have to dig. But, for now this should work fine. I’m limiting data fetch, so hopefully not a really huge thing.

Glad to have helped! If you end up needing a more complex/fine grained solution, you can hook into the Supabase’s SDK that’s being initiated by the WeWeb’s plugin directly, with some JS. This will allow you to do anything really.

> [@Kawwl](#):
>
> The weird thing is that it worked even though i didn’t bind my listener to anything yet on this page. Strange?

That might be something @aurelie might be interested in, as she’s the boss of the components as far as I understood. You can also open a support (bug) ticket if you deem it worth the time.
