2015-07-24 19:58:29 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var sqlite3 = require('./index');
|
|
|
|
|
|
|
|
function create(opts) {
|
|
|
|
var cluster = require('cluster');
|
|
|
|
var numCores = require('os').cpus().length;
|
|
|
|
|
|
|
|
if (!opts.serve && ('boolean' !== typeof opts.serve)) {
|
|
|
|
opts.serve = (numCores > 1) && cluster.isMaster;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!opts.connect && ('boolean' !== typeof opts.connect)) {
|
|
|
|
opts.connect = (numCores > 1) && cluster.isWorker;
|
|
|
|
}
|
|
|
|
|
|
|
|
return sqlite3.create(opts);
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports.sanitize = sqlite3.sanitize;
|
2015-07-24 20:47:11 +00:00
|
|
|
module.exports.escape = sqlite3.escape;
|
2015-07-24 19:58:29 +00:00
|
|
|
module.exports.create = create;
|
2015-11-10 12:16:50 +00:00
|
|
|
module.exports.createServer = sqlite3.createServer;
|
|
|
|
module.exports.createMasterClient = sqlite3.createMasterClient;
|