Revert "Fixed small regression on DatabaseQuery->toString"

This reverts commit 448cc216d794430abe292cc8fee7b8a585f12ad6.