Answers for "install sqlite3 nodejs"

SQL
2

install sqlite npm

npm i sqlite3
Posted by: Guest on May-16-2021
0

node js sqlite3

var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(':memory:');

db.serialize(function() {
  db.run("CREATE TABLE lorem (info TEXT)");

  var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
  for (var i = 0; i < 10; i++) {
      stmt.run("Ipsum " + i);
  }
  stmt.finalize();

  db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
      console.log(row.id + ": " + row.info);
  });
});

db.close();
Posted by: Guest on May-28-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language