inibase 1.4.7 → 1.4.9
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/index.js +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -228,7 +228,7 @@ export default class Inibase {
|
|
|
228
228
|
table.schema?.length) {
|
|
229
229
|
const replaceOldPathes = Utils.findChangedProperties(this.schemaToIdsPath(tableName, table.schema), this.schemaToIdsPath(tableName, schema));
|
|
230
230
|
if (replaceOldPathes)
|
|
231
|
-
await Promise.
|
|
231
|
+
await Promise.allSettled(Object.entries(replaceOldPathes).map(async ([oldPath, newPath]) => {
|
|
232
232
|
if (await File.isExists(join(tablePath, oldPath))) {
|
|
233
233
|
// if newPath is null, it means the field was removed
|
|
234
234
|
if (newPath === null)
|
|
@@ -1581,7 +1581,7 @@ export default class Inibase {
|
|
|
1581
1581
|
.name.split("-")
|
|
1582
1582
|
.map(Number);
|
|
1583
1583
|
}
|
|
1584
|
-
await Promise.
|
|
1584
|
+
await Promise.allSettled((await readdir(tablePath))
|
|
1585
1585
|
?.filter((fileName) => fileName.endsWith(this.getFileExtension(tableName)))
|
|
1586
1586
|
.map(async (file) => unlink(join(tablePath, file))));
|
|
1587
1587
|
if (globalConfig[this.databasePath].tables.get(tableName).config.cache)
|
|
@@ -1615,13 +1615,13 @@ export default class Inibase {
|
|
|
1615
1615
|
}
|
|
1616
1616
|
if (pagination[1] &&
|
|
1617
1617
|
pagination[1] - (Array.isArray(where) ? where.length : 1) > 0) {
|
|
1618
|
-
await Promise.
|
|
1619
|
-
await Promise.
|
|
1618
|
+
await Promise.allSettled(files.map(async (file) => renameList.push(await File.remove(join(tablePath, file), where))));
|
|
1619
|
+
await Promise.allSettled(renameList
|
|
1620
1620
|
.filter(([_, filePath]) => filePath)
|
|
1621
1621
|
.map(async ([tempPath, filePath]) => rename(tempPath, filePath)));
|
|
1622
1622
|
}
|
|
1623
1623
|
else
|
|
1624
|
-
await Promise.
|
|
1624
|
+
await Promise.allSettled((await readdir(tablePath))
|
|
1625
1625
|
?.filter((fileName) => fileName.endsWith(this.getFileExtension(tableName)))
|
|
1626
1626
|
.map(async (file) => unlink(join(tablePath, file))));
|
|
1627
1627
|
if (globalConfig[this.databasePath].tables.get(tableName).config.cache)
|
|
@@ -1673,7 +1673,7 @@ export default class Inibase {
|
|
|
1673
1673
|
RETURN[column] = await File.sum(columnPath);
|
|
1674
1674
|
}
|
|
1675
1675
|
}
|
|
1676
|
-
return
|
|
1676
|
+
return columns.length > 1 ? RETURN : Object.values(RETURN)[0];
|
|
1677
1677
|
}
|
|
1678
1678
|
async max(tableName, columns, where) {
|
|
1679
1679
|
const RETURN = {};
|