TypeORM -> classic ORM, the "default" choice in node, but not very mature compared to what exists in Java or things like Django ORM. In my experience it's not an amazing lib, transaction management is a bit painful, I've seen a couple bugs happen.
Knex -> it works but not sure why you'd use that rather than TypeORM
MikroORM -> not a lot of experience, one of my colleagues really likes it, read the principles behind it and see if that talks to you as it's a bit opinionated
Slonik -> Never used it but probably what I'd set up on a new project. Like many people I think that query builders are BS and I'd rather use SQL: Slonik makes that very easy while giving you the usual getOne/getMany utilities
I'd like to try Prisma though, I've heard good things
It's been excellent for me -- I ignore the bad abstractions, have a good underlying database (postgres), and drop down to parametrized raw SQL whenever I need to, it's held up extraordinarily well I think.
Could you expand on some specific issues/frustrations? Just curious about the side I'm clearly not seeing.
The things that the DB can do (I'm thinking about postgres) are amazing, and you just aren't going to get a chance to use a lot of it really from a lowest common denominator ORM. Yeah, you probably don't need it -- but then again why not just use a tool like Postgrest from the start?
The downside for me about dropping into raw SQL is that it makes much of the usefulness of an ORM in being able to refactor your schema and stuff disappear, because the type system and instrumentation can’t auto-refactor a raw SQL string. But I agree that I’d take that over relying on TypeORMs bugginess.
> I’m just scratching the surface, it’s telling that there are 1500+ unresolved issues on the repo and 200+ unmerged PRs.
So just a side note on this, I judge repositories based on teh ratio of closed to unresolved (and whether they have a bot that auto-closes issues). 200+ unmerged PRs is bad -- that maintainer needs help. I've interacted with the main maintainer before a long time ago and I had a good impression, but they probably weren't ready for how big their project got (how can anyone be) and they clearly didn't charge enough to make it a joy to work on their project. Money isn't the main motivator for everyone, but it would enable hiring people, or taking vacations as appropriate, etc.
There are quite a few other ORMs for working with DBs in TypeScript (none of them providing the same type-safety guarantees that Prisma does though [1]).
In fact, we laid them out on a docs page [2] in case you want to learn which tool might be appropriate for your use case.
[1] https://www.prisma.io/docs/concepts/more/comparisons/prisma-...
[2] https://www.prisma.io/docs/concepts/overview/should-you-use-...
What I am looking for is ideally something that helps with type saftey and seeds/migrations/schema creation.
The thing is of course that with very complex queries you'll end up making quite intricate string building stuff which may not be very pretty. I myself am curious to find out if Prisma can make that part go away.
There is also a good discussion going on here: https://www.reddit.com/r/node/comments/l00fit/what_do_you_th...