PrismaModule as globle in neatjs with prisma service and dburl
How to #parametrize db url if i want to always pass this url from my request.
I want like db per tanant model...
2 Replies
Hi @hari_narayan
You can create a new PrismaClient instance for each request, passing the tenant-specific database URL:
See this documentation:
https://www.prisma.io/docs/orm/reference/prisma-client-reference#programmatically-override-a-datasource-url
Prisma Client API | Prisma Documentation
API reference documentation for Prisma Client.
This is another example from the documentation that you can reference.
https://www.prisma.io/docs/orm/more/help-and-troubleshooting/nextjs-help#handling-dynamic-scenarios
Comprehensive Guide to Using Prisma ORM with Next.js | Prisma Docum...
Learn best practices, monorepo strategies, and dynamic usage techniques for Prisma ORM in Next.js applications.