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

One way back up of Hive data to Google Drive (Not sync; Just backup) #416

Closed
mma180s2 opened this issue Aug 25, 2020 · 2 comments
Closed

Comments

@mma180s2
Copy link

Question
I am relatively new to Dart and Flutter. Pls forgive me if this has been answered before. I did look through the docs and issue list to find potential ways my requirement could be solved but I could not find it. What I need is similar to #7

I have a long list of transaction data (just texts) stored using Hive on Flutter Web using IndexedDB inside a Progressive Web App running on iOS Safari.

My primary reading writing location is the IndexedDB Hive on the device Safari and at the end of the day, I would like to offer a button for user to tap which would export all the Hive data into a file and the file will be put inside a google drive. It is one way and there is no requirement for any other app to access the google drive file. In certain situations I have seen developers put an SQLite dB file on google drive/ Dropbox etc.

I would also need to be able to consume/ import back the file from google drive if the user changes to a new device etc.

Question

  1. May I check if there are already APIs available that I can use to instruct Hive to export all its data to a single file and APIs to consume back that single file to populate the data let's say on a new device? Failing that, do I have to go through each data entry and prepare JSON myself every time user taps on the backup button and also write the code to read the json back and populate the data back into hive?

Thanking everyone in advance for the advice!

  • Platform: iOS, Mac, Web
@mma180s2 mma180s2 reopened this Aug 25, 2020
@mma180s2
Copy link
Author

Reopening.

@themisir
Copy link
Contributor

themisir commented Aug 26, 2020

Since hive uses different backends for web and mobile we do not offer in house solution for backup/restore. But you can export fields to a file (eg: json) file and then parse on mobile device and put it to hivedb. If you need more assistance let me know.

Can hive sync data with a server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants