More work on working on PosrgreSQL locally

Why am I concerned with working locally?
Best practices and all that, yadda yadda yadda.
Although it's easy to set up a new Heroku pg instance, externalizing a dev component is a bit of half-assed job.
Plus, once you're working on a project that is connected to Heroku and has a live DB, you shouldn't be messing with the live data.

anyway.

I got a local db going with my roughed-up code.
I did find that it needs work.

I have a DBInit call - that should be handled by the call to Next() automagically, if required.
and the DB_INIT_RECORD thing -- currently it doesn't return anything.
In a timer-driven bot that just means we wait until the second iteration.
BUT THAT IS CRAP.

Who writes this stuff, anyway?

Oh, yeah. I did.
Why didn't I write it better?

Because I wrote what worked. It worked, and I "shipped it" -- put the bot live.

Now I want to do better.

This is the local connection: query.connectionParameters = "postgres://postgres:password@localhost:5432/postgres";
Following the schema of connString = "postgres://username:password@localhost/database";

The following node.js session worked, roughly:

> var sequencer = new (require('./sequencer.js'))

> sequencer.next().then(function() { console.log(arguments); });
{ state: [Function],
always: [Function],
then: [Function],
promise: [Function],
pipe: [Function],
done: [Function],
fail: [Function],
progress: [Function] }
> { '0': 'QUERY ERROR: error: relation "sequence" does not exist' }

> sequencer.initDB().then(function(status) { console.log(status); });
initializing DB
{ state: [Function],
always: [Function],
then: [Function],
promise: [Function],
pipe: [Function],
done: [Function],
fail: [Function],
progress: [Function] }
> Database initialized
Database initialized

> sequencer.next().then(function() { console.log(arguments); });
{ state: [Function],
always: [Function],
then: [Function],
promise: [Function],
pipe: [Function],
done: [Function],
fail: [Function],
progress: [Function] }
> DB initialized with first record

> sequencer.next().then(function() { console.log(arguments); });
{ state: [Function],
always: [Function],
then: [Function],
promise: [Function],
pipe: [Function],
done: [Function],
fail: [Function],
progress: [Function] }
> currentIndex: 0
{ '0': 'first' }

> sequencer.next().then(function() { console.log(arguments); });
{ state: [Function],
always: [Function],
then: [Function],
promise: [Function],
pipe: [Function],
done: [Function],
fail: [Function],
progress: [Function] }
> currentIndex: 1
{ '0': 'second' }