appwrite-utils-cli 0.9.52 → 0.9.53
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/README.md
CHANGED
@@ -124,6 +124,7 @@ This updated CLI ensures that developers have robust tools at their fingertips t
|
|
124
124
|
|
125
125
|
## Changelog
|
126
126
|
|
127
|
+
- 0.9.53: Reduced delay, went too far
|
127
128
|
- 0.9.52: Add delay after creating indexes, attributes, and others to prevent `fetch failed` errors during large-scale collection creation
|
128
129
|
- 0.9.51: Fix transfer databases, remove "ensure duplicates" check
|
129
130
|
- 0.9.5: Fixed not checking for storage bucket for each database (checking the creation status) when importing data
|
@@ -218,7 +218,7 @@ export const createUpdateCollectionAttributes = async (db, dbId, collection, att
|
|
218
218
|
}
|
219
219
|
});
|
220
220
|
// Add delay after each batch
|
221
|
-
await delay(
|
221
|
+
await delay(500);
|
222
222
|
}
|
223
223
|
console.log(`Finished creating/updating attributes for collection: ${collection.name}`);
|
224
224
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Databases, Query } from "node-appwrite";
|
2
|
-
import { tryAwaitWithRetry } from "../utils/helperFunctions.js";
|
2
|
+
import { delay, tryAwaitWithRetry } from "../utils/helperFunctions.js";
|
3
3
|
import { fetchAllCollections } from "../collections/methods.js";
|
4
4
|
export const fetchAllDatabases = async (database) => {
|
5
5
|
const databases = await tryAwaitWithRetry(async () => await database.list([Query.limit(25)]));
|
@@ -28,6 +28,7 @@ export const wipeDatabase = async (database, databaseId) => {
|
|
28
28
|
console.log(`Deleting collection: ${collectionId}`);
|
29
29
|
collectionsDeleted.push({ collectionId, collectionName: name });
|
30
30
|
await tryAwaitWithRetry(async () => await database.deleteCollection(databaseId, collectionId));
|
31
|
+
await delay(100);
|
31
32
|
}
|
32
33
|
return collectionsDeleted;
|
33
34
|
};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "appwrite-utils-cli",
|
3
3
|
"description": "Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.",
|
4
|
-
"version": "0.9.
|
4
|
+
"version": "0.9.53",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
package/src/databases/methods.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Databases, Query, type Models } from "node-appwrite";
|
2
|
-
import { tryAwaitWithRetry } from "../utils/helperFunctions.js";
|
2
|
+
import { delay, tryAwaitWithRetry } from "../utils/helperFunctions.js";
|
3
3
|
import { fetchAllCollections } from "../collections/methods.js";
|
4
4
|
|
5
5
|
export const fetchAllDatabases = async (
|
@@ -41,6 +41,7 @@ export const wipeDatabase = async (
|
|
41
41
|
await tryAwaitWithRetry(
|
42
42
|
async () => await database.deleteCollection(databaseId, collectionId)
|
43
43
|
);
|
44
|
+
await delay(100);
|
44
45
|
}
|
45
46
|
|
46
47
|
return collectionsDeleted;
|