简体   繁体   English

Flutter SQLite 数据库表存在但 SQFLite 未检测到

[英]Flutter SQLite database table exists but not detected by SQFLite

I wanted to fill a SQLite database with some initial data required for my app so I made a flutter app and used it to fill generate that database with the SQFLite package and then took it and put it in the assets folder of the app it will be used in, but when I query the initial data table it tells me that the table doesn't exist although the file size says that there is data in there and I used an online SQLite viewer website and the table with the data were there, So what to do?..我想用我的应用程序所需的一些初始数据填充 SQLite 数据库,所以我制作了一个 flutter 应用程序,并用它来填充生成该数据库的 SQFLite package,然后将其放入应用程序的资产文件夹中用于,但是当我查询初始数据表时,它告诉我该表不存在,尽管文件大小表明那里有数据,我使用了在线 SQLite 查看器网站,并且带有数据的表在那里,所以该怎么办?..

A quick way to dump an existing database is schema is:转储现有数据库的一种快速方法是模式是:

print(await db.query("sqlite_master"));

Without code, hard to say whether you correctly open the database from your assets .没有代码,很难说您是否正确地从您的资产中打开了数据库

You should also check that the existing database has indeed the data using some 3rd party tool (sqlite3, sqlite browser).您还应该使用某些 3rd 方工具(sqlite3、sqlite 浏览器)检查现有数据库是否确实有数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM