Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup and Restore for Web #2777

Open
BinaryShrub opened this issue Dec 7, 2023 · 1 comment
Open

Backup and Restore for Web #2777

BinaryShrub opened this issue Dec 7, 2023 · 1 comment
Labels
backend-web-wasm enhancement New feature or request

Comments

@BinaryShrub
Copy link

BinaryShrub commented Dec 7, 2023

Looking to offer a backup/restore option (that I plan to integrate with Google Drive API) for automated periodic backups. I read https://drift.simonbinder.eu/docs/examples/existing_databases/ but it seems to be targeted for NativeDatabase

How can I achieve backup and restore when targeting web and all the possible fallbacks?

@simolus3
Copy link
Owner

simolus3 commented Dec 7, 2023

At the moment this is fairly complicated because there is no uniform file system API on the web, so drift implements a number of approaches. But drift's file system implementation is not part of the public API.

I think you can do imports by using WasmDatabase.probe and then calling deleteDatabase on an existing database and using open with an initializeDatabase function resolving to the blobs to import.

@simolus3 simolus3 added enhancement New feature or request backend-web-wasm labels Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend-web-wasm enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants