|
|
|
@ -85,15 +85,15 @@ class Datastore extends EventEmitter { |
|
|
|
|
/** |
|
|
|
|
* Load the database from the datafile, and trigger the execution of buffered commands if any |
|
|
|
|
*/ |
|
|
|
|
loadDatabase () { |
|
|
|
|
this.executor.push({ this: this.persistence, fn: this.persistence.loadDatabase, arguments: arguments }, true) |
|
|
|
|
loadDatabase (...args) { |
|
|
|
|
this.executor.push({ this: this.persistence, fn: this.persistence.loadDatabase, arguments: args }, true) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
loadDatabaseAsync () { |
|
|
|
|
loadDatabaseAsync (...args) { |
|
|
|
|
return this.executor.pushAsync({ |
|
|
|
|
this: this.persistence, |
|
|
|
|
fn: this.persistence.loadDatabaseAsync, |
|
|
|
|
arguments: arguments |
|
|
|
|
arguments: args |
|
|
|
|
}, true) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -404,12 +404,12 @@ class Datastore extends EventEmitter { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
insert () { |
|
|
|
|
this.executor.push({ this: this, fn: this._insert, arguments: arguments }) |
|
|
|
|
insert (...args) { |
|
|
|
|
this.executor.push({ this: this, fn: this._insert, arguments: args }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
insertAsync () { |
|
|
|
|
return this.executor.push({ this: this, fn: this._insertAsync, arguments: arguments, async: true }) |
|
|
|
|
insertAsync (...args) { |
|
|
|
|
return this.executor.push({ this: this, fn: this._insertAsync, arguments: args, async: true }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -602,12 +602,12 @@ class Datastore extends EventEmitter { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
update () { |
|
|
|
|
this.executor.push({ this: this, fn: this._update, arguments: arguments }) |
|
|
|
|
update (...args) { |
|
|
|
|
this.executor.push({ this: this, fn: this._update, arguments: args }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
updateAsync () { |
|
|
|
|
return this.executor.pushAsync({ this: this, fn: this._updateAsync, arguments: arguments }) |
|
|
|
|
updateAsync (...args) { |
|
|
|
|
return this.executor.pushAsync({ this: this, fn: this._updateAsync, arguments: args }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -650,12 +650,12 @@ class Datastore extends EventEmitter { |
|
|
|
|
return numRemoved |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
remove () { |
|
|
|
|
this.executor.push({ this: this, fn: this._remove, arguments: arguments }) |
|
|
|
|
remove (...args) { |
|
|
|
|
this.executor.push({ this: this, fn: this._remove, arguments: args }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
removeAsync () { |
|
|
|
|
return this.executor.pushAsync({ this: this, fn: this._removeAsync, arguments: arguments }) |
|
|
|
|
removeAsync (...args) { |
|
|
|
|
return this.executor.pushAsync({ this: this, fn: this._removeAsync, arguments: args }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|