https://supabase.com/ logo
#help
Title
# help
j

jmsunseri

12/29/2021, 12:21 PM
how do you configure what data associated with the user from the db is returned i the user_metadata object when a session is returned after loggin in?
l

Lavka

12/29/2021, 12:27 PM
That object is just the content of users.raw_user_meta_data column in auth schema
j

jmsunseri

12/29/2021, 12:28 PM
well i don't want to shove duplicate data in there. is there a way to pull other data in?
l

Lavka

12/29/2021, 12:33 PM
By updating that table with SQL client on the server-site is a possible way of doing it, but I would not recommend it and rather go with a custom table (like profiles) in the regular public schema.
That column is intended as a place where auth providers dump the payload from the response
j

jmsunseri

12/29/2021, 12:34 PM
right i have a table called projects with a id. i would like to returned the ids of the projects associated with the user in the metadata object
l

Lavka

12/29/2021, 12:36 PM
I would recommend making an extra request which returns that relation. I expect that you have some table like public.project_members or something like that
j

jmsunseri

12/29/2021, 12:38 PM
it's going to be such a frequent request made through out the app i was hoping to not have to make the same request on every trip
l

Lavka

12/29/2021, 12:40 PM
Or create a custom Postgres function which will return users projects with RPC call
j

jmsunseri

12/29/2021, 12:42 PM
hmm
l

Lavka

12/29/2021, 12:43 PM
Can you cache that result? I am for example using a react-query as a wrapper that holds the data in the cache
j

jmsunseri

12/29/2021, 12:45 PM
server side?
l

Lavka

12/29/2021, 12:49 PM
No, on the client site. I don't think that the repetitive calling will be that big of a deal as you might think 🙂
j

jmsunseri

12/29/2021, 12:57 PM
just trying to get ride of repetitive waste