4 ms·
Yep. The ORM situation in JS is not great. There’s no one go-to, and it seems like the question often prompts a patronizing response about how ORMs aren't reall
by mattgreenrocks 1y ago
Yep. The ORM situation in JS is not great. There’s no one go-to, and it seems like the question often prompts a patronizing response about how ORMs aren't really necessary. Kysely is really great, but it’s not an ORM.
My take: the JS ecosystem tends to avoid abstraction for whatever reason. Example: they don’t believe that their web framework should transparently validate that the form submission has the correct shape because that’s too magical. Instead the Right Way is to learn a DSL (such as Zod) to describe the shape of the input, then manually write the code to check it. Every single time. Oh and you can’t write a TS type to do that because Reasons. It all comes off as willful ignorance of literally a decade or more of established platforms such as Rails/Spring/ASP.NET. All they had to do was steal the good ideas. But I suspect the cardinal sin of those frameworks was that they were no longer cool.
I have a hard time relaying this without sounding too negative. I tried to get into SSR webdev with TS and kept an open mind about it. But the necessary ingredients for me weren’t there. It’s a shame because Vite is such a pleasure to develop with.
- stephen 1y agoWell, we're not the "go to" yet :-) but if you want an entity-based ORM that isn't just a query builder, Joist has several amazing features (no N+1s) and great ergonomics https://joist-orm.io/ https://joist-orm.io/
- esperent 1y ago> There’s no one go-to I thought Prisma.js was the most popular by far? It's the one I've always seen used in docs and examples.
- DangitBobby 1y agoYes it's pretty good though it falls short of my golden standard (Django) by missing good automatic migrations and transactions in migrations.
- TranquilMarmot 1y agoWe had to write a migration layer on top of Prisma that can run arbitrary code to do things like transactions in migrations. Kind of a bummer that something like that's not built-in to the system but it was also trivial to put together.
- welder 1y agoNot anymore, now it's Drizzle
- switch007 1y agolol and next year it'll be something else. Drizzle isn't even 1.x
- actsasbuffoon 1y agoThe curse of being an experienced developer is watching good things go away, and then get re-invented and everyone hails them as a major innovation without any awareness that this has existed for a long time. Someone will steal the good ideas eventually. And everyone will act like it’s the first time this idea has ever come up. I’ve seen it happen a few times now, and each time it makes me feel ancient.
- bombela 1y agoIt's happening for me too often the older I get. I remember reading the seniors of my days complaining about it. I guess it's my turn now... As a side effect this reminds me how much I must not know what I don't know. It's a bit scary.
- welder 1y agoThe go-to is Drizzle
- TranquilMarmot 1y agoThat's funny, I would say the go-to is Prisma. We use it heavily and have not had any issues.
- switch007 1y agoVery lucky to not have encountered one of the 500 open and confirmed bugs!
- TranquilMarmot 1y agoA project suffering from success. The more usage, the more edge cases you'll find and the more bug reports.
- welder 1y agoI've used both and Drizzle has become the goto now in the TS community.
- TranquilMarmot 1y agoI'll try it out next time I need to build something. Where I work, as an org, we have gone all-in on Prisma across dozens of projects so getting buy-in to try something else will be an uphill battle.
- switch007 1y agoWhen not even 1.x?
- k4rli 1y agoWhat's wrong with TypeORM (besides being javascript of course)? Works alright, creates migrations based on entities automatically, and I really haven't had any issues with it. Even having several different dbs in the same project is straightforward.