Hi. I am hoping you have already had a similar cas...
# support-questions-legacy
b
Hi. I am hoping you have already had a similar case to this and can advise. We have userId in most of our data so that we know who performed the action. We are creating reports with BigQuery and would like to join that field to Supertokens to get the user primaryEmail. Is there a simple way to do this?
r
hey @bteres are you self hosting supertokens?
b
Yes.
r
right. So i think we have tables in which we store the user's email mapped to their user ID. You can pick it up from thjat
b
OK. So we just link directly to the PostGres instance?
r
yea. that would be the best way
b
OK. Will see what we can do. Thanks. Do you have the table name we should use?
r
emailpassword_users / thirdparty_users / passwordless_users
depending on which login method you use
b
Cool. Thanks.
I made a mistake. We are not using the self=hosted option.
r
ah right
then, well, you don't have access to the prod db directly
so instead, i would recommend you store a mapping of user id -> email in your own db and then use that
or, im not sure if bigquery allows you to query any source. Then you can use our core's api to get the user object from the user id and extract the email from that too
b
OK. That is what I thought. Thanks.