The orm is usually not the problem, it's usually that people don't know what they are doing and introduce serious performance issues.
I think an ORM makes more sense in a functional language since the interfaces are more likely to be declarative than imperative. For example, an in-memory List and a SQLQuery can both implement a filter() method that takes a function and applies it in the way most efficient to that data structure; in traditional OO languages, we usually loop over our in-memory structures explicitly, and doing that with a database is prohibitive.
My opinion is that one uses an ORM for different situations than they would use SQL. Many applications can use an ORM and nothing else. Some can use an ORM for basic CRUD tasks and then raw SQL to do analysis or reporting.
It's also available standalone as "DataGrip", though I've never used it:
For me, that's Scala JVM on the server, ScalaTags/ScalaCSS/ScalaJS in the web browser, Slick for the ORM, and SBT for the build system. The bliss of learn once, program anywhere.
When this hits reality though, I use Relate https://github.com/lucidsoftware/relate (disclaimer: I'm a contributor)
It's SQL, but with minimal syntactic overhead.
sql"SELECT * FROM users WHERE email IN ($emails)".asList[User]()[1]: https://www.playframework.com/documentation/2.5.x/ScalaAnorm...
I don't quite understand it. Your DBMS isn't some ambivalent data store with simple universal semantics.
I'm not just talking about SQL features like complex subselects or CTEs, but index hints, lock order, transactional visibility, non-trivial column constraints, index locks...
These matter in appreciably sized public-facing (e.g. web) systems. Granted, with enough transactions and roundtrips to application logic, an ORM can mimic these.
Now, I do know YAGNI; you might never get to a scale where an ORM poses a limitation.
I just suppose I don't see large enough benefits of learning and using an ORM in the early stages, to outweigh the cost of switching to SQL in the (admittedly hypothetical) later stages.