Apfelsaft
11/10/2021, 10:21 PMApfelsaft
11/10/2021, 10:21 PMApfelsaft
11/10/2021, 10:31 PMsupabase.from("flats").select("id").eq("shortcode, "my_shortcode")
returns only the row that has the specific shortcode?silentworks
11/10/2021, 11:29 PMApfelsaft
11/11/2021, 8:10 AMsilentworks
11/11/2021, 9:21 AMWHERE
clause, you can only run SQL inside of a RLS policyApfelsaft
11/11/2021, 5:01 PMprofiles(PK id, FK flat_id)
and a table flats(PK id, shortcode)
. Every user can live in a flat. So user "A" is in a flat and wants to invite "B" to join. flat.shortcode
is a random x-letter code. So A sends B the shortcode, which is then entered into the app.
Now the problem is: My RLS policy for selecting flats allows users to only see the flat assigned to their profile like this: (id = ( SELECT profiles.flat_id FROM profiles WHERE (profiles.id = uid())))
. That's why the query of B returns no rows.Apfelsaft
11/11/2021, 5:02 PMsilentworks
11/11/2021, 7:09 PM