title: knex select() returns before completing query in javascript
body: <p>I have a function like this:</p>
  
  <pre><code>function get_projects() {
      var project_names=[];
      knex('projects').select('name').then(function (a) { 
          project_names.push(a);
      })
      return project_names;
  }
  </code></pre>
  
  <p>This function executes the return statement <code>return project_names;</code> before completing <code>project_names.push(a)</code> statement and what I get after calling this function is an empty array, even though my db has results (I can see this if i log within the function a())</p>