Abstract generic sql formatter.