@bbn/bbn 1.0.383 → 1.0.384
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/db.js +7 -3
- package/package.json +1 -1
package/dist/db.js
CHANGED
|
@@ -101,10 +101,14 @@ var dbObject = function (dbName) {
|
|
|
101
101
|
};
|
|
102
102
|
this.update = function (table, data, where) {
|
|
103
103
|
return new Promise(function (resolve) {
|
|
104
|
-
var _a = getStore(table, 'w'), tx = _a[0], store = _a[1];
|
|
105
|
-
var arch = structure[table];
|
|
106
|
-
var primary = arch.keys.PRIMARY.columns.length > 1 ? arch.keys.PRIMARY.columns : arch.keys.PRIMARY.columns[0];
|
|
107
104
|
_this.selectAll(table, [], where).then(function (rows) {
|
|
105
|
+
if (!rows.length) {
|
|
106
|
+
resolve(0);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
var _a = getStore(table, 'w'), tx = _a[0], store = _a[1];
|
|
110
|
+
var arch = structure[table];
|
|
111
|
+
var primary = arch.keys.PRIMARY.columns.length > 1 ? arch.keys.PRIMARY.columns : arch.keys.PRIMARY.columns[0];
|
|
108
112
|
var res = 0;
|
|
109
113
|
for (var i = 0; i < rows.length; i++) {
|
|
110
114
|
var newData = extend({}, rows[i], data);
|