title: How does `db.serialize` work in `node-sqlite3`
body: <p>Recently I'm learning to use node and <a href="https://github.com/mapbox/node-sqlite3" rel="noreferrer">node-sqlite3</a> to manipulate sqlite3, here is a sample.</p>
  
  <pre><code>var sqlite3 = require('sqlite3');
  var db = new sqlite3.Database(':memory:');
  db.serialize(function() {
      db.run("CREATE TABLE test(info TEXT)");
      db.run("INSERT INTO test (info) VALUES ('info1')");
  })
  db.close();
  </code></pre>
  
  <p>The documentation said that <code>db.serialized</code> was used to ensure SQL lines were executed in order, but I was confused, why wouldn't they get executed in order without <code>db.serialize</code>, after all they would be pulled from the event queue and executed in order? How does it work here?</p>
  
  <p>And if there is only one sql to be executed, is it safe to run it without <code>db.serialize</code> as follows?</p>
  
  <pre><code>var sqlite3 = require('sqlite3');
  var db = new sqlite3.Database(':memory:');
  db.run("CREATE TABLE test(info TEXT)");
  db.close();
  </code></pre>