μSQLite module
Posted: Sat Oct 16, 2021 12:12 pm
Hi MicroPython developers.
I've been lurking here for a while and finally have something I hope is worthwhile to share with the MicroPython community, namely μSQLite for MicroPython or simply usqlite, a SQLite based database module for MicroPython.
Some may ask why "would you want to a SQL database on a microcontroller device?". In many cases simple text files like CSV and other formats will work perfectly well for reading and storing data. In my case I want to be able to record data in a structured format as well as be able to look up reference data quickly which is stored in in indexed tables. I also want the databases to be "ready to use" in other applications without having to import or convert to other formats.
The implementation of μSQLite tries to take advantage of MicroPython's clever memory management and virtual file system support to achieve effective performance and functionality in constrained device environments.
The module is beta and under development but so far initial tests are promising. I've been primarily targeting the Raspberry Pi Pico and have been pleased so far in how it has been working out. Typical peak memory usage in my test cases has been under 32Kb. In practice, this would of course vary more widely depending on the complexity of the application and the SQL statements being executed.
A description of the module and how to get started and compile it can be found in the GitHub repository - https://github.com/spatialdude/usqlite/ ... /README.md
Please feel free to try it out. Feedback is welcome.
I look forward to hearing from the the first person that jumps in and tries it out!! I hope the instructions are simple and clear enough on what to do.
I've been lurking here for a while and finally have something I hope is worthwhile to share with the MicroPython community, namely μSQLite for MicroPython or simply usqlite, a SQLite based database module for MicroPython.
Some may ask why "would you want to a SQL database on a microcontroller device?". In many cases simple text files like CSV and other formats will work perfectly well for reading and storing data. In my case I want to be able to record data in a structured format as well as be able to look up reference data quickly which is stored in in indexed tables. I also want the databases to be "ready to use" in other applications without having to import or convert to other formats.
The implementation of μSQLite tries to take advantage of MicroPython's clever memory management and virtual file system support to achieve effective performance and functionality in constrained device environments.
The module is beta and under development but so far initial tests are promising. I've been primarily targeting the Raspberry Pi Pico and have been pleased so far in how it has been working out. Typical peak memory usage in my test cases has been under 32Kb. In practice, this would of course vary more widely depending on the complexity of the application and the SQL statements being executed.
A description of the module and how to get started and compile it can be found in the GitHub repository - https://github.com/spatialdude/usqlite/ ... /README.md
Please feel free to try it out. Feedback is welcome.
I look forward to hearing from the the first person that jumps in and tries it out!! I hope the instructions are simple and clear enough on what to do.