Adds a function to return the result list from the db

The tests pass, but the db doesn't fit the required test yet