node + sqlite3:在哪种情况下你不需要序列化操作?

时间:2016-09-26 18:46:36

标签: node.js sqlite

嗨,我正在看这个例子:

//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()?我们不需要序列化数据库的情况是什么?

0 个答案:

没有答案