Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Implement backupToStorage appwrite function #304

Conversation

geryjuhasz
Copy link

No description provided.

@geryjuhasz
Copy link
Author

out

logs

storage

Copy link
Contributor

@Meldiron Meldiron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments.

$db = new Database($client);
$data = [];
$tempFile = tmpfile();
$collections = $db->listCollections();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add pagination, this will only return 25 collections.

$collections = $db->listCollections();
foreach ($collections['collections'] as $collection)
{
$appwriteDocuments = $db->listDocuments($collection['$id']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add pagination, this will only return 25 documents.

Comment on lines +24 to +26
unset($document['$id']);
unset($document['$collection']);
unset($document['$permissions']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this optional using environment variable?

Comment on lines +30 to +34
## 🎯 Trigger

```bash
php index.php collectionId ...
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the trigger, let's explain how it can be executed: Using "execute now" button in Appwrite console or using createExecution in client/server-side SDKs.

@christyjacob4
Copy link
Member

@geryjuhasz closing this PR for now since there has been no activity in quite a long time. Feel free to reopen it when you're ready to start working on it once again. 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants