When comparing MikroORM vs Prisma, the Slant community recommends Prisma for most people. In the question“What are the best JavaScript ORMs?” Prisma is ranked 2nd while MikroORM is ranked 3rd.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Implicit Transactions
MikroORM allows handling transactions automatically. When you call em.flush(), all computed changes are wrapped inside a database transaction.
Pro Powered by Unit of Work and Identity Map
Manages in memory state of loaded entities for you.
Pro DRY Entities
Uses source code analysis so you do not have to repeat yourself when defining entities. Simply define correct TypeScript types and you are good to go!
Pro Allows multiple ways to define entities
You can use decorators or define your schema via EntitySchema helper. You can also define custom MetadataProvider to customize how the discovery works.
Pro Easy-to-use and convinient way to use it
The first easy-to-use and convinient ORM in Typescript for Node.js
Pro SQL layer built on top of Knex
Allows to use knex directly (as well as native SQL) and map results to entities easily.
Pro Supports both SQL and NoSQL
Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite databases, and more can be supported via custom drivers right now.
Pro EntityGenerator
Allow to generate entities from existing database schema to get you up in speed.
Pro Great documentation
Pro Type safety
Prisma generates types out of a schema, enabling type safety across your application
Pro TypeScript native support
Pro VSCode plugin
Great support for VSCode with autocompletion, quick fixes, syntax highlighting of the Prisma schema
Pro Introspection
Introspects your database to generate a schema you can use to generate your client makes it simple to get started with existing databases.
Pro Declarative single source of truth for your database schema
Pro Integrated migration tool
Prisma Migrate makes it easy to create migrations for production.
Pro Great support
Actually responds on issues or the Prisma Slack with helpful answers.
Cons
Con No support for code first models
Can't add models in code first. You have to use Prisma's files to define your models and then let it generate the code for you.
Con Lack of NoSQL Support
Currently doesn't officially support NoSQL databases. There is a connector in preview for MongoDB, but no word on when it'll be fully released yet.
