Prisma & Store Procedures

Hello everyone, Does Prisma support calls to stored procedures? If so, could someone explain how to do it or share a relevant link, article, or repository with guidance?. PD: I use Postgres Any help would be greatly appreciated!
4 Replies
Prisma AI Help
Prisma AI Help•6d ago
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.
Nurul
Nurul•5d ago
Hey 👋 You can use Prisma's raw query functionality to execute stored procedures in PostgreSQL, like this:
// Using $queryRaw (template literal)
const result = await prisma.$queryRaw`CALL your_procedure_name(param1, param2)`;

// Or using $queryRawUnsafe (string)
const result = await prisma.$queryRawUnsafe('CALL your_procedure_name(param1, param2)');
// Using $queryRaw (template literal)
const result = await prisma.$queryRaw`CALL your_procedure_name(param1, param2)`;

// Or using $queryRawUnsafe (string)
const result = await prisma.$queryRawUnsafe('CALL your_procedure_name(param1, param2)');
Jude Bellingham
Jude BellinghamOP•5d ago
Oh okok, perfect. Thanks friend!
Nurul
Nurul•14h ago
No worries 🙂

Did you find this page helpful?