title: node promise is not executing synchronously
body: <p>I am trying to use node promises to create a sequence that is called synchronously so that a result is available to be returned to the caller.</p>
  
  <p>My code is as shown below. </p>
  
  <pre><code>console.log("Call Outer HubTest");
  var outerConnection;
  var ret = mysql.createConnection({
      host     : 'localhost',
      port     : '3306',
      user     : 'MyUser',
      password : 'MyPwd',
      database : 'MyDb'
  }).then(function (conn) {
      console.log("OuterhubTest: Set Connection to "+conn);
      outerConnection = conn; 
  }).then(function (result) {
      console.log("OuterhubTest: Connection is"+outerConnection);
      return outerConnection.query("SELECT 1");
  }).then(function (rows) {
      console.log("OuterhubTest: Rows of length "+rows.length);
  }).catch(function (err) { console.log("Error was "+err)})
  console.log("After OuterhubTest");
  </code></pre>
  
  <p>The trace I observe implies that the chain is being invoked asynchronously:-</p>
  
  <pre><code>Call Outer HubTest
  After OuterhubTest
  OuterhubTest: Set Connection to [object Object]
  OuterhubTest: Connection is[object Object]
  OuterhubTest: Rows of length 1
  </code></pre>
  
  <p>If this was synchronous, I would have expected all OuterhubTest trace to have been before "After OuterhubTest". I am not sure what I am doing wrong.
  Thanks in advance</p>