title: node-mysql2 and prepared statements
body: <p>I'd like to know what could I use as alternative for PHP PDO in Node.js</p>
  
  <p>I've found <a href="https://github.com/sidorares/node-mysql2" rel="nofollow">node-mysql2</a>, they talk about <strong><code>prepared statements</code></strong> but I can't find a way to cache the statement to reuse it.</p>
  
  <p>With PHP I do:</p>
  
  <pre><code>$sth = $pdo-&gt;prepare('SELECT 1+? AS test1');
  $sth-&gt;execute( Array(10) );
  $sth-&gt;execute( Array(20) );
  </code></pre>
  
  <p>And with this I don't prepare the query each time, I juse use the prepared one changing the variable value.</p>
  
  <p>With node-mysql2 instead I do:</p>
  
  <pre><code>connection.execute('SELECT 1+? AS test1', [10], function(err, rows) {
    //
  });
  </code></pre>
  
  <p>But I can't find a way to take advantages by the prepared statement feature.</p>