Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get a GUI for an SQLite database created in flutter for android simulator?

I created a database main.db in flutter, located at the ApplicationDocumentsDirectory.path. This worked without any problem.

But for easier maintanance and not always having to create an SQL-Statement to see the data or structure I'd like to get a GUI to watch the database. First I wanted to use Browser DB for SQLite but I don't know where the database is saved on my notebook, if so. Also I can't find it with Agent Ransack either.

Is there a way to find the database or maybe an easier way to see the database on a GUI?
I use Visual Studio Code for development if that's any help.

like image 300
Oliver Avatar asked Jul 23 '19 07:07

Oliver


People also ask

How do I view SQLite database in flutter?

View > Tool Windows > Device File Explorer. Here you will find your Flutter application files, the main database will be located inside the 'app_flutter folder'. Once you've located the database file, right click and save as. You can then open this db file with BrowserDB or sqlitebrowser.

Can we use SQLite in flutter?

Now you can start using SQLite in the Flutter project!


1 Answers

For Android, the easiest way I have found is to just have Android Studio installed on my machine as well. In Android Studio you can view the database on the device via Device File Explorer

View > Tool Windows > Device File Explorer.

In the new tab make sure your device is selected e.g

MyAndroidDevice > data > data >com.myflutterapp

Here you will find your Flutter application files, the main database will be located inside the 'app_flutter folder'.

Once you've located the database file, right click and save as. You can then open this db file with BrowserDB or sqlitebrowser.

There might be a similar way to do it with Xcode as well, but I'm not so familiar with that particular IDE.

like image 179
F-1 Avatar answered Nov 15 '22 09:11

F-1