How do I open a sqflite database file in DB Browser for SQLite?

戏子无情 提交于 2020-05-30 09:40:37

问题


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,

  1. Right click the folder
  2. Click Upload
  3. Select the file with the database changes
  4. (Not sure if this is needed but I did it just to be safe) Right click the folder or file and click synchronize
  5. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!