Change the way to do fetching all rows in the sql database.