@sirber sorry autocorrect screwed my comment.
I used to use orms but they caused more problems.
I was spending more time figuring out how to write a query in orm syntax where as I knew already how to do it in sql.
Query builders come to the rescue they are in between orms and plain typless sql in code.
They provide some type safety but you can use sql in your backend framework.
Knex.js is the one I use.