Make sql logging more sane

It is possible to just copy/paste sqls now