Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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();
Comment

PREVIOUS NEXT
Code Example
Javascript :: nodejs user input 
Javascript :: replace all character in string javascript 
Javascript :: javascript format date time 
Javascript :: how to prevent event capturing in javascript 
Javascript :: count array filter javascript 
Javascript :: queryselector get each element 
Javascript :: json vs gson 
Javascript :: aws amplify get JWT TOKEN 
Javascript :: days array javascript 
Javascript :: jquery display modal bs4 
Javascript :: js string slicing 
Javascript :: sequelize order with include 
Javascript :: how to show modal with jquery 
Javascript :: read excel file through nodejs 
Javascript :: how to know actual scroll js 
Javascript :: save canvas as image from website 
Javascript :: join array js 
Javascript :: javascript sum digits in string of numbers 
Javascript :: testing library react hooks 
Javascript :: eintegrity npm error 
Javascript :: sum all numbers in a range javascript 
Javascript :: set timeout JS for loop 
Javascript :: set navigation drawer to open by default react native 
Javascript :: add new items in a select input using js 
Javascript :: jquery on form submit call function 
Javascript :: how to remove class in all siblings javascript 
Javascript :: localstorage set 
Javascript :: angular library run tests 
Javascript :: axios get with headers 
Javascript :: remove duplicate elements array javascript 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =