New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues cross-referencing tables from different schemas using Prisma #1502
Comments
It looks like Prisma doesn't allow cross schema joins, which would need to be fixed on their side.
I think the best way around it is to copy the changes of I'll close this one because I'm not sure there is anything we can do on our side. Feel free to drop some comments if you get stuck though and I'll reopen |
Thank you for sharing this. Are there any limitations/drawbacks using Also besides |
if you using Supabase for user management (log in, out, etc), then we put everything in the The drawbacks would be:
It depends on what you are doing with the tables, but I doubt you will need to copy the data over to the If you aren't using Supabase for User management then you can actually ignore all these tables completely and just build everything into the |
Makes sense. I am still considering to use Supabase Auth or Next Auth. Maybe Next Auth is a bit more customizable at this point. But looking to the future, all the Row Level Security with Supabase Auth stuff seems quite intriguing. |
For anyone coming here in the future, the page linked by @kiwicopple above no longer contains the needed information but I found it in the git history here https://github.com/supabase/supabase/blob/1315bac01bec4fc70ebc0184b524cd9d890e749d/web/docs/guides/auth.mdx#create-a-publicusers-table |
We have a doc here for managing user data: https://supabase.io/docs/guides/auth/managing-user-data |
Can you actually use Row Level Security when using Prisma? I.e. can you use the auth helper functions |
Is there any update on this? Especially @mr-bjerre 's question.. I'm trying to implement the same thing, but Prisma by passes any RLS poilcy set up (most likely as it's using the |
Following as well. This would be the perfect combo (supabase & prisma) but it seems as if there's no progress on ether side. |
I'm looking to set up the exact same thing, I want to manage my tables using Prisma, but have the auth automatically handled by Supabase, it would be amazing. According to this thread:
But I can't seem to figure out how, and I can't find any tutorials or code examples. I'm new to Supabase, and I'd really love it if someone could help me to find a way to set this up correctly. Did any of you guys find a solution? |
This worked for me: schema.prisma:
then This requires every model to have define an additional property |
For anyone wondering how to create the trigger, the link referenced in this thread is deprecated. This is the new link to the supabase docs https://supabase.com/docs/guides/auth/managing-user-data#advanced-techniques |
I tried to do this as well today, however after adding all my new Models, the |
Apparently after doing https://www.prisma.io/docs/orm/prisma-schema/data-model/multi-schema |
Feature request
Is your feature request related to a problem? Please describe.
I am trying to use Supabase together with Prisma. There seems to be a problem cross-referencing tables in different schemas. I have
auth.users
andpublic.profiles
.Describe the solution you'd like
I would like to be able to use Prisma to manage Supabase DB, but currently I cannot use Auth schema if it's referencing any of the tables in the public schema.
Is there are way around this issue?
Additional context
Error message from Prisma CLI:
The text was updated successfully, but these errors were encountered: