TypeScript ORMs
So, I’m starting a new backend typescript project, and I’m wondering about which ORM I should use.
I’ve used mongoose with mongodb before, which I very much didn’t like.
I’d say I’m pretty experienced with TS and SQL individually.
I’m planning on using postgresql, and I’m wondering if anyone has any insights on what to use as a SQL-experienced, TS ORM noob.
6 Replies
I'd say, to take a look into Drizzle-kit
It's pretty close to SQL, which is good, and it's got great documentation.
Not an ORM but instead a query builder, check out Kysely. It’s a fully type-safe query builder and works very well. We are using it in production
Sadly kysely doesn’t have migration
Actually, they do bust they are hand written
Personally I like how kysely does migrations over how ORMs do, but yeah still need to write up/downs
My current personal project I used Postgres + Prisma and now regret the decision.
I pretty sure I'm only doing basic data handling, but I've already run into situations Prisma doesn't support. So Ill be avoid Prisma going forward.
I've used Sequelize for small apps before and it worked pretty well. Not sure how well it would scale though
Sequelize
Sequelize is a modern TypeScript and Node.js ORM for Oracle, Postgres, MySQL, MariaDB, SQLite and SQL Server, and more. Featuring solid transaction support, relations, eager and lazy loading, read replication and more.