0
votes

im using react-native-sqlite-storage For database https://github.com/andpor/react-native-sqlite-storage

Now i have pre-populated-sqlite-database in .../www/ folder for both android & ios.

Now insert some data with query & get proper output of it in app. But now im delete database from /www folder but still its results are get in app. SO i think its create copy database of it.

how im get proper database path for this copy database file for both android & ios in react-native

2
You can find path using path module and __dirname. Then you can delete the file using that.helloworld
not proper idea about that, can you please provide some detail about that @helloworldumang desai

2 Answers

0
votes

When you deploy an app (or use in emulator), the database is copied to the platform and isn't the same as www/ folder. If you want to remove data from app

Either uninstall and install (it will copy again from www)

OR

Clear Application Data (that will clean all storage and make app as originally installed)

If you're keen to find path (though I couldn't think of a usecase), You can run make use of package like https://www.npmjs.com/package/react-native-fs and run code within App.js to find current directory and console.log it.

0
votes

Run your app with Xcode and it will show you in Xcode console local database path copy that path and find it in Finder (macOS) and you will get you database file