Redwood: An integrated, full-stack, JavaScript web framework for the JAMstack
While prisma2 is probably the best node ORM, it still has a lot of issues. It seems to take a lot of inspiration from the mongo api, which is a good idea, as that is the one thing mongo got right. There are a bunch of issues with it though:<p>It should be closer to the mongo api.<p><pre><code>  await prisma.users.findOne({ where: { id: 1 } })
</code></pre>
should just be<p><pre><code>  await prisma.users.findOne({ id: 1 })
</code></pre>
for example.<p>It is trying to do too much. There is a hard limit of where ORMs try to take over too many of the things you do in SQL and become slow and complex and a big black hole. prisma tries to do migrations, table creation, etc, etc. These things rarely work properly.<p>Lazy loading never works. Somewhere litered in your code you access a field that is outside the scope of the pulled in data and it is in a loop and suddenly you have 100 requests. You have to look through your entire function to understand which fields are inside and outside of the scope of the query, and add more includes or whatever.<p>There are security issues with ORMs that traverse and save relationships, as github itself found out. You add user__roles form field maliciously on the client side to a form that was just supposed to update the user and not the roles, then suddenly you find your user.save() method on the server-side has traversed and added new roles to a user.<p>I am writing a kind of orm today based on the mongo api without all the $ signs, much like prisma, but closer and without all the additional things. github username is thebinarysearchtree.<p>ORMS should just be for fairly simple, single table tasks. That way they get out of the road and don&#x27;t become some big complex thing that ruins performance and adds its own complexity.