add support for postgres datastore

This pull request does a few things:

  1. Defines a `GearmanDatabase` base class
  2. Converts the old sqlite code to an implementation of a `GearmanDatabase` (`SQLite`)
  3. Adds a `Postgres` implementation of `GearmanDatabase`, and makes it the default (and currently only) option
  4. Adds tests for the `GearmanDatabase` interface, testing both the `Postgres` and the `SQLite` implementations
I don't want to change too much stuff at once... I think we should stick
with postgres for a while with existing limits and if performance seems
good bump it up, and probably not to 30 right away - maybe to 15 first or
something.

Thoughts?

On Fri, Dec 12, 2014 at 3:22 PM, Colin Schimmelfing <
notifications@github.com> wrote:
>
> In routes.coffee
> <https://github.com/Clever/gearman-admin/pull/41#discussion-diff-21774209>
> :
>
> > @@ -20,7 +21,10 @@ module.exports = (app) ->
> >    auth = auth app
> >
> >    # Every minute, delete jobs older than 4 days
> > -  setInterval (-> db.delete_old_jobs 4), 600000
> > +  setInterval ->
> > +    cutoff = moment(new Date()).subtract(4, 'days').toDate()
>
> let's do 30 days, now that we have postgres!!
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Clever/gearman-admin/pull/41/files#r21774209>.
>