问题
I have a Flutter/Dart application that I am coding using Android Studio. I use a database called envirodatabase.db with the sqflite
package. I want to open the database in DB Browser for SQLite on my computer, but the only way it lets me do that is through saving a copy of the file, not the file itself.
How do I open the original file in DB Browser for SQLite?
Here is my Device File Explorer
What I tried doing was I right clicked > Save As in the Device File Explorer where my app's database was. I saved it to my desktop and opened it, but the changes don't update the original file.
Similar questions with different problems:
- Viewing sqlite database file using DB browser for SQlite
回答1:
Android Studio saves files you open this way in a temporary directory outside of your project. If you make modifications to a file you opened using the Device File Explorer, and would like to save your changes back to the device, you must manually upload the modified version of the file to the device.
https://developer.android.com/studio/debug/device-file-explorer
What I had to was, back in the Device File Explorer, after saving to Desktop and making changes,
- Right click the folder
- Click Upload
- Select the file with the database changes
- (Not sure if this is needed but I did it just to be safe) Right click the folder or file and click synchronize
- Hot restart the application (hot reload may also work, but again, just to be safe).
来源:https://stackoverflow.com/questions/61684314/how-do-i-open-a-sqflite-database-file-in-db-browser-for-sqlite