Support sorting of db results.