I have a crazy idea. Imagining running a prisma OR...
# ideas-and-suggestions
u
I have a crazy idea. Imagining running a prisma ORM inside an rpc function. So i dont need to string sql. Is that possible? 😅😅
s
Prisma is an ORM. It sits at the code level and maps the data in the DB schema to JS output, as opposed to sitting at the DB level. I haven't worked with Prisma (though I have worked with Sequelize), but if you know the return structure of the RPC, surely it's possible to write support for it in your models? More to the point, I believe that just about everything you'd be able to do with a Postgres function would be possible to do within Prisma. Maybe I'm misunderstanding what you're trying to do.
u
@User Right now i really dont know how will i put the prisma on RPC Prisma requires
schema.prisma
file which will be a generator to generate your client. So before you can use prisma u need to use code generation first like a
npm command
to the that.