- create a database using SQLite.openDatabase()
- connect to device via adb shell and manually delete the database
- reload the app
- database file is not recreated (even though SQLite.openDatabase code is executed again)
- queries do not fail with error. Just returns 0 result.
Is it openDatabase loads it into memory? How do we force it to physically check if database file is present?
On the same note, what is the recommended way to delete a local sqlite db?
If I press the restart button in XDE and the project rebuilds, it seems to recreate the db.
On the android device, If I navigate to settings->app-> expo and click Force Stop, it seems to recreate the database file.
@nikki do you know the answer to this?
@ccheever @nikki following up on this.
How are you manually deleting the database?
step 2 above:
connect to device via adb shell and manually delete the database
so i simply rm the physical database file.
@nikki Following up on this. Am interested to know your thoughts.
@nikki how can I upgrade the database when the database design is changed ( changing on the version of the db ) , there is no delete method in SQLite class, and the version parameter will be ignored in the open method according to your documentation
“name (string) — Name of the database file to open.
The version, description and size arguments are ignored, but are accepted by the function for compatibility with the WebSQL specification”
Any suggestion please.
So, currently there isn’t a specific method to delete or upgrade SQLite databases. Created an issue to track this here: https://github.com/expo/expo/issues/639
We can scope this feature for the SDK for at least version 22. @msanduka do you think you could do a workaround by creating new tables within the database?
was reading the changelog for sdk v24 today and saw this change made it in.