ORMs like Diesel are definitely very useful. The problem I have with them is that their ORM abstraction often leaks. Fixing these abstraction leaks is a hard problem [1].
Ofc, there has been attempts to reconcile relational DBs with OOP like languages, but they are not very popular. [2]
PgTyped and some similar libs try to solve a simpler problem (typing static queries) and can be used to build more complex solutions when needed.
Writing query result/param type assertions by hand and using tests to guarantee type synchronization between DB and code wasn't maintainable on most projects I have seen.
While I like SQLAlchemy a lot, it has to be said that it leaks like a sieve.
Personally I think the problem is not that ORMs are leaky abstractions, it's that they often pretend not to be. SQLAlchemy just leaks unapologetically, if you struggle with ORM you can drop right down to using an DSL to construct SQL or just write SQL directly without feeling like you have to fight the ORM and mess with undocumented internals you shouldn't be touching.
PgTyped and some similar libs try to solve a simpler problem (typing static queries) and can be used to build more complex solutions when needed.
Writing query result/param type assertions by hand and using tests to guarantee type synchronization between DB and code wasn't maintainable on most projects I have seen.
[1] https://en.wikipedia.org/wiki/Object-relational_impedance_mi...
[2] https://en.wikipedia.org/wiki/The_Third_Manifesto