some more mileage in reimplementing the Task Queue API in SQL