☹️ We need ORM again because of modern databases...
I don't like ORM over SQL databases.
My main complaint about most of them is that they create their own syntax, which you not only need to learn but also figure out what final SQL it will generate.
An example of such an ORM is Prisma.
This unpredictability (and most often non-optimization) and the fact that I'll have to learn something else besides SQL is what I strongly dislike.
I thought I could refuse to use ORM forever and use Query Builder / Typed SQL, but then I discovered one very interesting detail:
One of the important properties of modern databases is horizontal scalability and auto-sharding.
And for such databases, supporting relational consistency (following relational rules, like CONSTRAINT in PostgreSQL) is a very difficult task (it's also called Referential Integrity).
Examples of such databases are PlanetScale and YDB.
Therefore, they shift this responsibility to the user, which means we need to describe in our code which entities have pointers to each other and what to do when changing / deleting / creating a particular entity.
Damn, and that's exactly what most ORMs have, because they come with their own built-in schema...
So, it's too early to give up on ORM, BUT we definitely need to look at ORMs that are close to SQL in spirit, such as drizzle (I'll experiment with it and write back about what I find).