Improved syntax for with-connection macro.
Add test for complex queries.