-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
changing location property is not showing the DB #19
Comments
location
property is not working while opening DB using open
I have the same problem: after modifying the location, I can't see the database file. Have you solved this problem? |
For now I am doing a "hack" like this: SQLite.openDatabase({ name: DB_NAME, location: "default" });
const dbFileLocation = RNFS.DocumentDirectoryPath.split(PACKAGE_NAME)[0] + PACKAGE_NAME;
const dbFilePath = dbFileLocation + "/databases/" + DB_NAME; The |
It doesn't absolutely replace the path. If you want to navigate to the databases folder you can use a relative path: SQLite.openDatabase({name: DB_NAME, location: '../databases'}) The problem is that doing it this way might break in future Android versions where the database path might change. |
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: