tekartik / sqflite

SQLite flutter plugin
BSD 2-Clause "Simplified" License
2.87k stars 525 forks source link

"database disk image is malformed" when open with external SQLite tools #986

Open Adrek opened 1 year ago

Adrek commented 1 year ago

Hello everyone,

I am testing the sqflite package and in the flutter app it works very well. List, register, update, delete. etc

My problem is that when I export the db from the emulator to the PC through windows and try to view it, I get an error

I have tried these tools:

This message appears on all of them: "database disk image is malformed"

I have tried creating a clean hello world app and adding only sqflite as a dependency, I created only one table with one column and no records. On the app side, everything is ok, there are no errors. But when exporting and viewing it in external tools, that error appears.

I also used the example from the README. in the app it works. but when exporting they give the same errors.

The command I use to export db is this: adb shell "run-as com.example.test_sqflite cat /data/user/0/com.example.test_sqflite/databases/animales.db" > D:\adrek\sqlite\animales.db

I leave the link to the exported db in case you want to review them: https://we.tl/t-S9SaHNmfSD

Am I doing something wrong?

alextekartik commented 1 year ago

Have you tried to copy the file using "adb pull" or using Android Studio file explorer (instead of the cat command which I think is more relevant for text files than for binary files)

EArminjon commented 1 year ago

Personally I use the android studio file explorer emulator. I don't have any issue.