SQLite Forum

SQLite3 for Teensy 4.1 - dirent.h
Login
Thanks Larry!

I'm currently studying [this ESP32 VFS](https://github.com/siara-cc/esp32_arduino_sqlite3_lib/blob/master/src/esp32.cpp) that jkreibich found. I'm halfway through it and it seems it can be pretty much compiled with arm-none-eabi to target the Teensy board without issues. A cosmetic renaming of ESP32* functions into Teensy* is the only modification I've done so far.

Apparently the author of the ESP32 VFS decided to make the locking and unlocking functions (lock(2), unlock(2), checkreservedlock(2)) no-ops even though the ESP32 has 2 cores and thus true parallellism is achievable. It makes sense considering the embedded applications that SQLite should power: a global pointer to the sqlite file and an I/O attempt every now and then for saving or aggregating data coming from a sensor. A crash or weird behavior in case of parallel access to the sqlite instance is somehow expected.

SPIFFS is a very lightweight filesystem for low-power devices and has wear-levelling. I'd say a sqlite3 VFS module on top of it is then sufficiently abstracted from the raw SD cells given the performance and durability expectations of such systems.