P
Prisma•2w ago
fwoelffel

Weak relations

Hi there, Is there any way to use Prisma relations without any foreign key constraint on Postgre? I'd like to be able to set this up on a per table basis and not for the whole database like relationMode = "prisma" would do. I've been looking online for this and it appears to be a feature that has been requested a couple years ago already. What's the status on this? Cheers
3 Replies
RaphaelEtim
RaphaelEtim•2w ago
Hi @fwoelffel You may want to atake a look at using relationMode= "prisma as documented here
Manage relations between records with relation modes in Prisma | Pr...
Manage relations between records with relation modes in Prisma
RaphaelEtim
RaphaelEtim•2w ago
When you use the relation mode, Prisma will not create foreign key constraints in the database. Relations are emulated by Prisma ORM using additional database queries and logic to maintain referential integrity
fwoelffel
fwoelffelOP•2w ago
Thank you for your answer 🙂 I just edited my question because it didn't give enough details about my usecase. Do you know its possible to define the relation mode only for a set of tables?
Want results from more Discord servers?
Add your server