A SQLite library module for MicroPython, providing a DB-API 2.0 subset compatible with Python's sqlite3.
μSQLite (usqlite) is a SQLite library module for MicroPython that enables SQL database functionality on embedded devices and microcontrollers. It provides a familiar DB-API 2.0 interface similar to Python's standard sqlite3 module, allowing developers to create, query, and manage SQLite database files directly from MicroPython code. The library solves the problem of persistent, structured data storage in resource-constrained environments where traditional databases are too heavy.
MicroPython developers working on embedded systems, IoT devices, or microcontroller projects who need reliable, file-based SQL database capabilities. This includes engineers building data-logging applications, device configuration systems, or any project requiring complex querying on small devices.
Developers choose usqlite because it brings full SQLite functionality to MicroPython with minimal overhead, maintains compatibility with standard Python SQL interfaces for easier code migration, and includes memory monitoring tools essential for constrained environments. Its cross-platform database file compatibility means data can be analyzed on desktop systems using standard SQLite tools.
μSQLite library module for MicroPython
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements a subset of DB-API 2.0 and is highly compatible with Python's sqlite3 library, easing porting for developers accustomed to standard Python SQL interfaces.
Creates standard SQLite database files that can be opened with desktop tools like DB Browser for SQLite, allowing seamless data analysis and transfer.
Provides functions like mem_current() and mem_peak() to track memory usage, crucial for debugging and optimizing in resource-constrained MicroPython environments.
Supports both indexed (?) and named (:name, @name) parameters for safe query construction, enhancing security and convenience over string concatenation.
The project is explicitly in beta, meaning APIs and features may change, leading to potential breaking updates and incomplete documentation for edge cases.
Requires integrating the SQLite C library into MicroPython builds via CMake, which can be daunting for developers unfamiliar with embedded toolchains or cross-compilation.
Only works with MicroPython ports; if a project switches to CircuitPython or another embedded Python variant, usqlite may not be supported or require significant porting effort.