Closed AVDeveloppement closed 3 years ago
You could customize the config file in this library to enable PRAGMA. But I doubt if it will work every time given the limited memory.
Thanks for answer, i tried, my config:
`#define BUILD_sqlite -DNDEBUG
/*
#define SQLITE_OMIT_FLAG_PRAGMAS 0
#define SQLITE_OMIT_INTEGRITY_CHECK 0
#define SQLITE_OMIT_PRAGMA 0
//#define SQLITE_OMIT_COMPLETE 1 //#define SQLITE_OMIT_SUBQUERY 1 //#define SQLITE_OMIT_DATETIME_FUNCS 1 //#define SQLITE_OMIT_FLOATING_POINT 1
*/ ` but that don't work, have you a tips for check db table are ok at startup ? Because sometime when power off esp32 when it use db it become corrupted on some table, i cant change hardware or add ups for prevent power off, i have added db backup so i have more than 100 db ok but how know when need restore :/
For whichever option you would like to remove, please try #undef instead of making it 0. However, I am not sure if enabling PRAGMA would serve your purpose. Why not just copy the backup back to original file? You could also try my other library http://github.com/siara-cc/sqlite_micro_logger_arduino if that suits you. It consumes much lesser memory and much faster if you just want to log sensor data.
I have table with users, settings, data, logs, ... the problem is sometime table are corrupted when i power off when it write db. I can't prevent that, ups cant be added. For that i make lot of backup auto but how know when we need restore a backup ? Hum test write and read every table at start? Sad PRAGMA can't be used :( but ok it's already good to have sqlite on esp thanks for that!
Any update here on the integrity test? Is there an example?
Thank you.
Hello, i don't find why PRAGMA don't work. I try:
i get empty result, same code with "select * from settings" get my table. I want use "PRAGMA integrity_check" for restore backup at start if error found. Thanks for the help.