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...