Typed static queries

I'm opening this PR so we can discuss the current state of the implementation.
This fails with `tsql` instead of `sqlu`. Can we make it work?