DharmaraJ
07/30/2021, 1:38 PMjonny
07/30/2021, 1:38 PMehesp
07/30/2021, 1:40 PMjonny
07/30/2021, 2:25 PMDeleted User
07/30/2021, 3:35 PMganeshaha
07/31/2021, 10:03 AMSucipto
07/31/2021, 1:03 PMFlyken
07/31/2021, 6:37 PMFlyken
07/31/2021, 10:10 PMhttp418
07/31/2021, 11:04 PMScott P
07/31/2021, 11:29 PMburggraf
08/01/2021, 5:12 PMKhan W
08/01/2021, 5:13 PMburggraf
08/01/2021, 5:15 PMcdedreuille
08/01/2021, 9:36 PMsilentworks
08/01/2021, 9:42 PMwiverson
08/02/2021, 12:32 AMwiverson
08/02/2021, 12:33 AMwiverson
08/02/2021, 12:34 AMfrubalu
08/02/2021, 2:50 PMconst { data: pack, error: packError } = await supabase
.from('trip_packs')
.select(
`
pack:pack_id(*, categories(*, category_items(*), items(*)))
`
)
.match({ trip_id: tripId, user_id: me.id });
As you can see, it's a fairly complicated select method, trying to access data several relationships deep. It could be cool to do something like Prisma, which looks like this:
const getUser = await prisma.user.findUnique({
where: {
id: 19,
},
include: {
posts: true,
},
})
^ a user's posts are included.
Or even better (I come from a Rails background), the ability to set up eager loading relationships. So in my first example, I would just query for a Pack, and all of the nested categories and items would automatically be included in the query. Thanks for coming to my Ted Talk!Kosh
08/02/2021, 3:13 PMfrubalu
08/02/2021, 3:22 PM.select()
actually comes from Postgrest and not Supabase?Scott P
08/02/2021, 3:43 PM.subscribe()
is a little different, but essentially the initial query routes through Postgrest, and then connects to the realtime server to handle listening for changes. Auth ones are routed through GoTrue. In all cases, they all go through the Kong server.frubalu
08/02/2021, 3:44 PMfrubalu
08/02/2021, 9:46 PMKhan W
08/02/2021, 9:58 PM.eq
when .equal
would be more user friendly and easy to read and pick up. If there isn’t, I’d ask for adding the long names alongside the short onesfergus
08/02/2021, 11:53 PMfrubalu
08/02/2021, 11:55 PMfergus
08/02/2021, 11:55 PMfergus
08/02/2021, 11:57 PM