react-native-sqlite-storage icon indicating copy to clipboard operation
react-native-sqlite-storage copied to clipboard

Deleted db, remove app. But why app still work after rebuild?

Open Adcrazynoga opened this issue 6 years ago • 9 comments

I alredy deleted assets/my.db, WWW/my.db. But how can database work after that. Where is database ?

Adcrazynoga avatar May 08 '18 10:05 Adcrazynoga

database is created inside the app sandbox. see documentation on the location.

andpor avatar May 17 '18 20:05 andpor

@andpor hello. How to update the database in that case? I mean when you want to replace pre-populated db by another one.

Stafox avatar May 12 '19 14:05 Stafox

@Stafox I have run into this exact same problem? Did you guys end up with some sort of workaround?

vikramrao94 avatar Jul 03 '19 03:07 vikramrao94

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 avatar Jul 03 '19 06:07 Stafox

@Stafox How do you unzip the file first within React Native?

jeffmon avatar Jul 12 '19 20:07 jeffmon

@jeffmon I used react-native-zip-archive and react-native-fs

Stafox avatar Jul 12 '19 22:07 Stafox

@Stafox I was wondering how to use both libraries, how would you extract to /src/www?

(Thanks in advanced!)

jeffmon avatar Jul 13 '19 07:07 jeffmon

@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.

Stafox avatar Jul 13 '19 07:07 Stafox

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

infinitbility avatar Nov 25 '20 16:11 infinitbility