Open batuhansahan opened 3 years ago
do you guys have any ideas?
Also interested
Using RNFS, you can copy your DB file to preferred path. Tested in android.
const localDBFilePath = '/data/data/<package-id>/watermelon.db';
const databaseBackupFilePath = `${RNFS.DownloadDirectoryPath}/backup.db`;
await RNFS.copyFile(this.localDBFilePath, databaseBackupFilePath);
Hi, is anyone working on it? i am new to open source, how do i get started?
Using RNFS, you can copy your DB file to preferred path. Tested in android.
const localDBFilePath = '/data/data/<package-id>/watermelon.db'; const databaseBackupFilePath = `${RNFS.DownloadDirectoryPath}/backup.db`; await RNFS.copyFile(this.localDBFilePath, databaseBackupFilePath);
This doesn't work. The copied files won't necessarily be the same or reflect what's happening in memory.
Currently looking at how to best do this. FMDB (the sqlite objective-c wrapper that watermelondb uses) actually has a function to accomplish this loadOrSaveDb but the FMDB embedded in watermelondb doesn't have it and hasn't been updated since 2018.
I will probably fork, add that file, and expose to js to allow proper backup / restore on iOS. @radex and whoever is maintaining, please let me know if you have any thoughts on that. This is a robust project and obviously I'd like to get a PR merged and not stay on a fork.
any updates?
Is there a way to export / import(restore) database.