{"componentChunkName":"component---src-templates-post-tsx","path":"/posts/2019/07/node-sqlite-which/","result":{"data":{"markdownRemark":{"fields":{"slug":"/2019/07/node-sqlite-which/"},"frontmatter":{"title":"Various Node.js sqlite packages. What is the best?","tag":["node.js","javascript","sqlite"],"image":"https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/SQLite370.svg/1200px-SQLite370.svg.png"},"correctedDateEpoch":1563296400000,"html":"<p>The official implementation is actually <a href=\"https://www.npmjs.com/package/sqlite3\"><code>sqlite3</code></a>, and there are at least 2 packages built on top of it -- <a href=\"https://www.npmjs.com/package/sqlite\"><code>sqlite</code></a> and <a href=\"https://typeorm.io/#/\"><code>TypeORM</code></a>. There are also other packages that can run SQLite including <a href=\"https://www.npmjs.com/package/better-sqlite3\"><code>better-sqlite3</code></a> and <a href=\"https://github.com/kripken/sql.js/\"><code>sql.js</code></a>.</p>\n<!-- excerpt_separator -->\n<h2>Considerations</h2>\n<ul>\n<li>Easy to write / maintain</li>\n<li>Client-side / browser only</li>\n<li>Fast</li>\n<li><a href=\"https://electronjs.org/\">Electron.js</a>-enabled</li>\n</ul>\n<p>In my experience, it seems that, in Node.js environment, Promise-based <code>sqlite</code> seems the be the best. Also, being-based on <code>sqlite3</code>, it works well with Electron.js (<code>better-sqlite3</code> does not work well with Node.js. <code>sql.js</code> of course works, but it is not truly file-based.)</p>\n<p>However, <code>better-sqlite3</code> claims to be faster than <code>sqlite</code>...</p>\n<p>Being a TypeScript user, I am looking forward to try out <code>TypeORM</code> sometime.</p>"}},"pageContext":{"slug":"/2019/07/node-sqlite-which/"}}}