ID photo of Ciro Santilli taken in 2013 right eyeCiro Santilli OurBigBook logoOurBigBook.com  Sponsor 中国独裁统治 China Dictatorship 新疆改造中心、六四事件、法轮功、郝海东、709大抓捕、2015巴拿马文件 邓家贵、低端人口、西藏骚乱
nodejs/node-sqlite3/index.js
#!/usr/bin/env node

// https://cirosantilli.com/node-js-sqlite3-package

var assert = require('assert');
var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(':memory:');
db.serialize(() => {
db.run(`CREATE TABLE IntegerNames (value INTEGER, name TEXT)`)
db.run(`INSERT INTO IntegerNames VALUES (2, "two")`)
db.run(`INSERT INTO IntegerNames VALUES (3, "three")`)
db.run(`INSERT INTO IntegerNames VALUES (5, "five")`)
db.all('SELECT * FROM IntegerNames ORDER BY value ASC', (err, rows) => {
  assert.strictEqual(rows[0].value, 2)
  assert.strictEqual(rows[0].name, 'two')
  assert.strictEqual(rows[1].value, 3)
  assert.strictEqual(rows[1].name, 'three')
  assert.strictEqual(rows[2].value, 5)
  assert.strictEqual(rows[2].name, 'five')
})
})
db.close();