1
0
Derivar 0
Este cometimento está contido em:
AJ ONeal 2015-11-17 08:33:54 +00:00
ascendente efc10cab3b
cometimento cf5e734618
4 ficheiros modificados com 6 adições e 3 eliminações

Ver ficheiro

@ -429,6 +429,9 @@ module.exports.create = function (opts, verbs, mySocket) {
} }
}; };
if (opts.init) {
return db.init(opts);
}
return db; return db;
}); });
} }

Ver ficheiro

@ -1,6 +1,6 @@
{ {
"name": "sqlite3-cluster", "name": "sqlite3-cluster",
"version": "1.1.2", "version": "2.0.0",
"description": "A wrapper to enable the use of sqlite3 with node cluster via a socket server (i.e. for Raspberry Pi 2).", "description": "A wrapper to enable the use of sqlite3 with node cluster via a socket server (i.e. for Raspberry Pi 2).",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

Ver ficheiro

@ -84,7 +84,7 @@ function createApp(servers, options) {
switch(cmd.type) { switch(cmd.type) {
case 'init': case 'init':
console.log('[S] init', cmd); //console.log('[S] init', cmd);
db[cmd.func].apply(db, cmd.args).then(function () { db[cmd.func].apply(db, cmd.args).then(function () {
var args = Array.prototype.slice.call(arguments); var args = Array.prototype.slice.call(arguments);
var myself; var myself;

Ver ficheiro

@ -20,7 +20,6 @@ function create(opts, verbs) {
var PromiseA = verbs.Promise || require('bluebird'); var PromiseA = verbs.Promise || require('bluebird');
var dbname = ""; var dbname = "";
dbname += (opts.dirname || '');
dbname += (opts.prefix || ''); dbname += (opts.prefix || '');
if (opts.subtenant) { if (opts.subtenant) {
dbname += opts.subtenant + '.'; dbname += opts.subtenant + '.';
@ -31,6 +30,7 @@ function create(opts, verbs) {
dbname += (opts.dbname || ''); dbname += (opts.dbname || '');
dbname += (opts.suffix || ''); dbname += (opts.suffix || '');
dbname += (opts.ext || ''); dbname += (opts.ext || '');
dbname = require('path').resolve(opts.dirname || '', dbname);
function initDb(newOpts) { function initDb(newOpts) {
if (dbs[dbname].initPromise) { if (dbs[dbname].initPromise) {