spatialdude / usqlite

μSQLite library module for MicroPython
MIT License
90 stars 18 forks source link

usqlite_Error: file is not a database #29

Open emile-cronje opened 4 months ago

emile-cronje commented 4 months ago

Good day

I get the following intermittent errors when running micropython (windows port, dev and standard variants) with the attached script.

usqlite_Error: database disk image is malformed usqlite_Error: file is not a database

Sometimes it runs through successfully, but fails most of the time.

Sometimes it fails with null reference exceptions in different parts of sqlite3.c, so might be a loose pointer or buffer overflow?

usqlite_demo.zip

Regards

spatialdude commented 3 months ago

@emile-cronje Unfortunatley I don't know what is going on in your case, you might like to uncommeting #define SQLITE_OMIT_WAL 1 in usqlite_config.h which turns off the "write ahead log"

There are also many other compile time options which you can configure which might help identify what's might be going on in your situation.