BTC — ETH — ICP — SOL — LIVE · updates every 60s
LedgerLifeICP · BITCOIN · DEFI · WEB3
← LedgerLife ICP

SQLite Support Now Available in Internet Computer Canisters

By Maria Irene · 8 Oct 2025

Developers building on the Internet Computer (IC) can now integrate SQLite databases directly into their Rust-based canisters with the new ic-rusqlite package. This wrapper around the rusqlite crate makes it easier to embed SQLite functionality, providing local database capabilities without the need for a separate server.

Getting started involves adding ic-rusqlite to a project and configuring the canister to work with WebAssembly. Developers specify custom build steps to ensure compatibility with IC’s architecture, and the wasi2ic tool produces a WebAssembly executable ready to run on the network.

Database connections are created automatically on the first call to ic-rusqlite, and data is stored in stable memory. By default, the main database is located in a dedicated folder in the canister’s virtual file system, and settings can be adjusted to suit specific storage needs. This integration ensures that data persists even when canisters are upgraded, an important feature for applications that require consistent state over time.

The package also supports additional stable structures, allowing developers to allocate memory for other storage needs while keeping the main database safe. Using the memory manager is recommended to prevent accidental corruption of data stored in stable memory.

Performance is a key consideration, particularly with larger databases. Developers are encouraged to design schemas and queries to minimise heavy operations, as IC has instruction limits that can affect complex database tasks. Indexing and careful query planning can help maintain efficiency while working with SQLite within canisters.

For developers familiar with SQLite, ic-rusqlite brings a familiar database environment to the Internet Computer. It offers a practical, reliable, and efficient way to manage data-driven applications entirely within canisters.