@bbn/bbn 2.0.233 → 2.0.235
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/bbn.sw.js +1 -1
- package/dist/bbn.sw.js.map +1 -1
- package/dist/db.js +4 -2
- package/package.json +1 -1
package/dist/db.js
CHANGED
|
@@ -90,7 +90,7 @@ class DbObject {
|
|
|
90
90
|
return __awaiter(this, arguments, void 0, function* (database = '') {
|
|
91
91
|
let conn = db._connections[database || this.dbName];
|
|
92
92
|
if (!conn) {
|
|
93
|
-
|
|
93
|
+
yield db.open(database || this.dbName);
|
|
94
94
|
if (!db._connections[database || this.dbName]) {
|
|
95
95
|
throw new Error(_('The database %s is not open', this.dbName));
|
|
96
96
|
}
|
|
@@ -342,6 +342,8 @@ const db = {
|
|
|
342
342
|
if (conn) {
|
|
343
343
|
conn.close();
|
|
344
344
|
delete this._connections[database];
|
|
345
|
+
}
|
|
346
|
+
if (this._objects[database]) {
|
|
345
347
|
delete this._objects[database];
|
|
346
348
|
}
|
|
347
349
|
},
|
|
@@ -424,7 +426,7 @@ const db = {
|
|
|
424
426
|
if (!this._structures[database]) {
|
|
425
427
|
throw new Error(_('Impossible to find a structure for the database %s', database));
|
|
426
428
|
}
|
|
427
|
-
if (this._objects[database]) {
|
|
429
|
+
if (this._objects[database] && this._connections[database]) {
|
|
428
430
|
return this._objects[database];
|
|
429
431
|
}
|
|
430
432
|
yield new Promise((resolve, reject) => {
|