Portal has a ton of useful formatters and because it leverages Hiccup, it's really easy to build on top of it. I wrote a tiny toolkit for debugging:
- queries generated by HoneySQL
- dealing with invalid query exceptions thrown by Postgres
For small queries it's easy to figure out where the error is, but with multiple CTEs, conditionally building parts of the query, things get messy.