嗨,我正在看这个例子:
//Load modules
var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database('./database_name.db');
//Perform SELECT Operation
db.all("SELECT * from blah blah blah where this="+that,function(err,rows){
//rows contain values while errors, well you can figure out.
});
//Perform INSERT operation.
db.run("INSERT into table_name(col1,col2,col3) VALUES (val1,val2,val3)");
//Perform DELETE operation
db.run("DELETE * from table_name where condition");
//Perform UPDATE operation
db.run("UPDATE table_name where condition");
为什么不使用db.serialize()?我们不需要序列化数据库的情况是什么?