title: How Basic CRUD SQLite 3 With VueJs 2
body: <p>i Have problem with SQlite3 and Vue2</p>
  
  <p>I'm using <a href="https://github.com/SimulatedGREG/electron-vue" rel="nofollow noreferrer">Electron-Vue</a>, and I have installed SQLite3 and Require it Successfully (database.db)</p>
  
  <p>using this:</p>
  
  <pre><code>var sqlite3 = require('sqlite3').verbose();
  var path = require('path')
  var db = new sqlite3.Database(path.join(__dirname, '..', '/../','db', 'database.db'));
  </code></pre>
  
  <p>So next Step its difficult to me (Basic Crud System)?</p>
  
  <p>How to Add Like this Code to A Vue Component</p>
  
  <pre><code>db.serialize(function() {
  
  
  db.run("CREATE TABLE lorem (info TEXT)");
  
  var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
  for (var i = 0; i &lt; 10; i++) {
    stmt.run("Ipsum " + i);
  }
  
  stmt.finalize();
  
  var rows = document.getElementById("database");
  db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
    var item = document.createElement("li");
    item.textContent = "" + row.id + ": " + row.info;
    rows.appendChild(item);
  });
   });
  
   db.close();
  </code></pre>
  
  <p>Just a simple demo code to get started with VueJS2 Component and SQlite3!!</p>