是否有可能为在flutter中为Android模拟器创建的SQLite数据库获取GUI? [英] Is it possible to get a GUI for an SQLite database created in flutter for android simulator?

查看:44
本文介绍了是否有可能为在flutter中为Android模拟器创建的SQLite数据库获取GUI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我扑朔迷离地创建了一个数据库 main.db ,位于 ApplicationDocumentsDirectory.path 处.这项工作没有任何问题.

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

但是为了便于维护,而不必总是创建SQL语句来查看数据或结构,我想获得一个GUI来监视数据库.首先,我想对SQLite使用Browser DB,但是我不知道数据库在笔记本中的保存位置.同样,我也无法通过特工Ransack找到它.

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.

是否有找到数据库的方法,或者是更简单的在GUI上查看数据库的方法?
如果有帮助的话,我会使用Visual Studio Code进行开发.

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.

推荐答案

对于Android,我发现最简单的方法就是在计算机上也安装Android Studio.在Android Studio中,您可以通过设备文件资源管理器在设备上查看数据库.

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

在这里您将找到Flutter应用程序文件,主数据库将位于'app_flutter文件夹'中.

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

找到数据库文件后,右键单击并另存为.然后,您可以使用 BrowserDB sqlitebrowser .

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

也许也可以使用Xcode进行类似的操作,但是我对特定的IDE不太熟悉.

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

这篇关于是否有可能为在flutter中为Android模拟器创建的SQLite数据库获取GUI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆