简体   繁体   中英

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?..

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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