Supabase Joins + Realtime

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!

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 :+1:

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.

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
image

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

1 Like

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.

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.