sqliteandroid-studioflutterdatabase-managementdb-browser-sqlite

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


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

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:


Solution

  • 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 do 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).