1var sqlite3 = require('sqlite3').verbose();
2var db = new sqlite3.Database(':memory:');
3
4db.serialize(function() {
5 db.run("CREATE TABLE lorem (info TEXT)");
6
7 var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
8 for (var i = 0; i < 10; i++) {
9 stmt.run("Ipsum " + i);
10 }
11 stmt.finalize();
12
13 db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
14 console.log(row.id + ": " + row.info);
15 });
16});
17
18db.close();