https://supabase.com/ logo
#off-topic
Title
# off-topic
s

synchron

09/06/2021, 3:17 PM
Hi, is there a sql template/tutorial to create something like a "session for multiple users" like garticphone or something like that. The first user starts a session without logging in/signing up, shares the id and the other users can "join his session". Doodle makes the same, but more "async" (hope you understand what i mean...my eglish is not the best 😄 ) Thanks!
s

Scott P

09/06/2021, 3:28 PM
You could use something like
gen_random_uuid()
(requires the pgCrypto extension to be installed and enabled) to generate a UUID that could then be shared. Store that value in the database. When someone enters this ID to join the session, retrieve all records with that ID from the database. Everything else would be dependant on your backend and front-end architecture, as well as what you're trying to achieve.
s

synchron

09/06/2021, 3:30 PM
Ok, Thank you. I will have a look at these function. Maybe it solves my problem 🙂
Hi,
i think i dont get the "RLS" correct so, i want to ask... If a anonymous user wants to change things, like creating a session. I cant enable RLS right?
because if i enable it, the user is not allowed to change something unless he/she is logged in into the system
right? @User
s

Scott P

09/08/2021, 4:32 PM
It depends on what policies you implement. They can implement any logic you want as long as they return a boolean value. For example, an RLS update policy of
false
prevents people from changing any rows in the table that it's applied to. Likewise, an RLS select policy of
true
would allow anyone to view any data in that table.
s

synchron

09/09/2021, 7:26 AM
ah ok... Thank you
Thank you very much. got it working