SQLite Forum

SQLite3 for Teensy 4.1 - dirent.h
Login
As the Teensy doesn't have an OS, and associated OS services, you need to provide all the interfaces for things the OS would normally provide-- including file access.  In the case of SQLite, this is done via the "VFS" interfaces (https://www.sqlite.org/vfs.html).  Compiling the core SQLite library will require turning off the default VFS modules (I assume this can be done with #defs), and integrating one that works with the SPIFFS libs.  I'd guess you can modify the "unix-none" VFS module to suite your needs, replacing the standard file/OS calls with calls to the SPIFFS and other libraries.

Given that the Teensy mostly uses the Arduino environment, you might also be able to find an existing VFS module that can be used, or used with minimal modification.  This project looks like it might be a good starting point, although it includes the whole SQLite source code  (and is about a year behind, at 3.31.1), not just the required VFS module:
https://github.com/siara-cc/esp32_arduino_sqlite3_lib/tree/master/src

Overall, a project like this is going to take some non-trivial understanding of how SQLite is ported to different environments, and how to integrate it into the Teensy environment.  I'd start by spending some time understanding the VFS interfaces, and looking at the source code for the existing VFS modules used by higher level OSes.  Assuming you're comfortable with the SPIFFS libraries, it should be more apparent how to hook everything together.  It's not an out-of-the-box kind of thing, however.