title: knex.js - reading then updating throws an Error
body: <p>I'm trying to chain read and update operations. First I read (fetch) data from the database based on the <strong>id</strong>, then I change it and want to update the data in the database as well but I get a <code>Unhandled rejection Error: There is no pool defined on the current client</code> error.</p>
  
  <p><strong>index.js</strong></p>
  
  <pre><code>var id = args.id;
  var proj = new Project(id);
  
  proj.read(knex).then(function(rows) {
    proj.set(args);
    proj.update(knex).then(console.log); // &lt;== ERROR THROWN HERE
  });
  </code></pre>
  
  <p><strong>Project.js</strong> (only related functions)</p>
  
  <pre><code>read(knex) {
    var self = this;
  
    return knex('projects').where('id', this.id).then(function(rows) {
      if (rows.length == 0)
        throw '[panda] Read project: no project with id = ' + self.id;
      self.set(rows[0]);
  
      return self;
    });
  }
  
  update(knex) {
    console.log(knex('projects').where('id', this.id).update(this).toString());
  
    return knex('projects').where('id', this.id).update(this);
  }
  </code></pre>
  
  <p><strong>Command</strong></p>
  
  <pre><code>$ node index.js projects update --id=5 --name=Test-update
  update "projects" set "completion" = 0, "currentIteration" = NULL, "id" = 5, "name" = 'Test-update' where "id" = 5
  Unhandled rejection Error: There is no pool defined on the current client
      at /home/flawyte/development/projects/js/panda/node_modules/knex/lib/client.js:202:25
      at tryCatcher (/home/flawyte/development/projects/js/panda/node_modules/bluebird/js/main/util.js:26:23)
      at Promise._resolveFromResolver (/home/flawyte/development/projects/js/panda/node_modules/bluebird/js/main/promise.js:480:31)
      at new Promise (/home/flawyte/development/projects/js/panda/node_modules/bluebird/js/main/promise.js:70:37)
      at Client.acquireConnection (/home/flawyte/development/projects/js/panda/node_modules/knex/lib/client.js:200:12)
      at /home/flawyte/development/projects/js/panda/node_modules/knex/lib/runner.js:136:49
      at tryCatcher (/home/flawyte/development/projects/js/panda/node_modules/bluebird/js/main/util.js:26:23)
      at Function.Promise.attempt.Promise.try (/home/flawyte/development/projects/js/panda/node_modules/bluebird/js/main/method.js:31:24)
      at Runner.ensureConnection (/home/flawyte/development/projects/js/panda/node_modules/knex/lib/runner.js:135:26)
      at Runner.run (/home/flawyte/development/projects/js/panda/node_modules/knex/lib/runner.js:30:31)
      at QueryBuilder.Target.then (/home/flawyte/development/projects/js/panda/node_modules/knex/lib/interface.js:27:43)
      at /home/flawyte/development/projects/js/panda/index.js:80:31
      at tryCatcher (/home/flawyte/development/projects/js/panda/node_modules/bluebird/js/main/util.js:26:23)
      at Promise._settlePromiseFromHandler (/home/flawyte/development/projects/js/panda/node_modules/bluebird/js/main/promise.js:507:31)
      at Promise._settlePromiseAt (/home/flawyte/development/projects/js/panda/node_modules/bluebird/js/main/promise.js:581:18)
      at Promise._settlePromises (/home/flawyte/development/projects/js/panda/node_modules/bluebird/js/main/promise.js:697:14)
  </code></pre>
  
  <p>If I remove the <code>then(console.log)</code> in <strong>index.js</strong> no error is thrown but data in database remains unchanged after script ending. Why ?</p>