(maint) Add pretty SQL formatting

This patch converts all SQL code from the query engine into a pretty format
so it is easier to read from the debug output.

Signed-off-by: Ken Barber <ken@bob.sh>
Also, as this function will always return the same result in a running program seems like you could hoist this into a top-level var. `(def have-sql-pretty-print? (utils/class-exists? ...))`. Then you could just refer to that in the function.