react-native-sqlite-storage
react-native-sqlite-storage copied to clipboard
Deleted db, remove app. But why app still work after rebuild?
I alredy deleted assets/my.db, WWW/my.db. But how can database work after that. Where is database ?
database is created inside the app sandbox. see documentation on the location.
@andpor hello. How to update the database in that case? I mean when you want to replace pre-populated db by another one.
@Stafox I have run into this exact same problem? Did you guys end up with some sort of workaround?
For now I store it as zip archive and extract it when it has not been extracted yet. And it looks like problem has gone away.
But need to double-check it.
@Stafox How do you unzip the file first within React Native?
@jeffmon I used react-native-zip-archive and react-native-fs
@Stafox I was wondering how to use both libraries, how would you extract to /src/www
?
(Thanks in advanced!)
@jeffmon what OS are you talking about? iOS or Android?
For iOS i’ve put the zip into www folder (do not forget to add it to references using xcode) and then extract it to DocumentDirectoryPath.
I alredy deleted assets/my.db, WWW/my.db. But how can database work after that. Where is database ?
you have to re-install the application
Created separate posts for how to delete the database and how to check DB file location on user phone.
https://infinitbility.com/how-to-delete-sqlite-database-in-android-react-native