wouldn't that be neat...
However, there are Java frameworks that basically generate a type system from your database so whatever columns you query ends up being static types that can be determined at compile time. https://www.jooq.org/
Java is really quite cool. I wonder if we'll ever get a typescript version of jOOQ