noynek2242
noynek2242
Explore posts from servers
PPrisma
Created by noynek2242 on 9/11/2024 in #help-and-questions
Row Level Security Example
I'm playing with this example on client extension and row-level-security (RLS). The thing that's got me confused is the example gets a user just by grabbing the first item
const user = await prisma.$extends(bypassRLS()).user.findFirstOrThrow();
const user = await prisma.$extends(bypassRLS()).user.findFirstOrThrow();
I'm using next-auth and I can't figure out how to get the signed-in user from here. Any suggestions? https://github.com/prisma/prisma-client-extensions/blob/main/row-level-security/script.ts#L42
2 replies
PPrisma
Created by noynek2242 on 8/15/2024 in #help-and-questions
Multi-tenant approaches
I'm trying to figure out a multi-tenant approach and it's really confusing. I prefer to use a single postgresql DB and the RLS functionality looks ideal, but it also looks like it doesn't work with Prisma. This library was recently put into read-only https://github.com/Errorname/prisma-multi-tenant The Zenstack approach looks nice, but it adds a pretty big library and I haven't done enough research to know what I'm taking on. https://zenstack.dev/docs/the-complete-guide/part1/access-policy/ I'm also trying to figure out how well this works. I can't tell if it's just a prototype or if it's a stable approach https://github.com/prisma/prisma-client-extensions/tree/main/row-level-security Any suggestions? thanks
4 replies