Typed static queries

I'm opening this PR so we can discuss the current state of the implementation.
Can we get rid of this top-level config file and use a connection from testkit.conf?