Our great sponsors
-
prisma1
Discontinued 💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
MikroORM
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, MS SQL Server, PostgreSQL and SQLite/libSQL databases.
As much as I don't like to use it, there are people who decide that NoSQL and MongoDB are the way to go for their application. Before v7, Nest didn't provide it's own decorators for a mongoose integration, and developers had to use the standard schema approach. While there's nothing wrong with this, it definitely does bring in some pain points when it comes to types and DTOs, so a SchemaFactory was created to allow developers to keep using classes to define their mongoose schemas. This works pretty well, but does admittedly lack some features, like virtuals and static methods. These can be added to the generated schema, but Typescript will not know about them. I usually suggest people use nestjs-typegoose instead of Mongoose/Typegoose integration with NestJS.
Rewriting the metadata for a library is one thing. Writing an ORM is a whole different beast that no one on the Nest team feels confident enough to tackle. TypeORM was originally chosen because, at the time of creation, it had the best Typescript support. Keyword here being had. I've seen TypeO bite so many developers in the end and cause problems and usually suggest devs look for other options, like prisma or MikroORM (the MikroORM team maintains their own Nest module as well).
Rewriting the metadata for a library is one thing. Writing an ORM is a whole different beast that no one on the Nest team feels confident enough to tackle. TypeORM was originally chosen because, at the time of creation, it had the best Typescript support. Keyword here being had. I've seen TypeO bite so many developers in the end and cause problems and usually suggest devs look for other options, like prisma or MikroORM (the MikroORM team maintains their own Nest module as well).