queries: try to convert primary key to string automatically on grouped results