title: Writing SQL queries in nodejs
body: <p>This question is mainly about the best practice of writing queries in nodejs. We had referred several tutorials, but were not able to reach a conclusion.</p>
  
  <p>We have a node js API layer which is mainly used for reading and writing to database. Here is a sample code:</p>
  
  <pre><code>pool.query("update node SET changed = " + params.updationTime + " where nid = " + params.nid);
  pool.query("update node_revision SET timestamp = " + params.updationTime +" where nid = " + params.nid);
  pool.end();
  </code></pre>
  
  <p>Is this a correct way of writing code or should we write the sql queries in async format itself.</p>