query: added __str__ or to_sql  for all query classes