You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to save the DB file inside the App Data folder (e.g. /storage/emulated/0/Android/data/com.package.name). And I have this code:
// other importsimport{QuickSQLiteConnection,open}from"react-native-quick-sqlite";// get the app directoryconstexternalDirectory=RNFS.ExternalDirectoryPath;// --> /storage/emulated/0/Android/data/com.package.name/files location// open the dbconstdb=open({name: "default.db",location: externalDirectory});
This opens the DB fine, I am not able to see any file inside the above mentioned location. And, if I change the location property to any other directory (e.g. RNFS.DownloadDirectoryPath), this also not showing any DB, but if I revert to old location, I still have the older data.
My requirement is that I want to give an option to the user to export (backup) the local database, so that they can import it later, or onto any other devices. How can I achieve this?
Thank you in advance!
The text was updated successfully, but these errors were encountered:
devaarx
changed the title
location property is not working while opening DB using open
changing location property is not showing the DB
Sep 17, 2023
The RNFS.DocumentDirectoryPath will give the app data location + /files. So I split with my package name, and appending /databases/ + DB_NAME, so you will end up with your database file. You can copy it or do whatever you'd like. I am not sure if this will work in iOS.
I am trying to save the DB file inside the App Data folder (e.g.
/storage/emulated/0/Android/data/com.package.name
). And I have this code:This opens the DB fine, I am not able to see any file inside the above mentioned location. And, if I change the
location
property to any other directory (e.g.RNFS.DownloadDirectoryPath
), this also not showing any DB, but if I revert to old location, I still have the older data.My requirement is that I want to give an option to the user to export (backup) the local database, so that they can import it later, or onto any other devices. How can I achieve this?
Thank you in advance!
The text was updated successfully, but these errors were encountered: