Minisqlite: A Pure-Rust Reimplementation of SQLite
Minisqlite is a pure-Rust reimplementation of SQLite, byte-compatible with its on-disk format, spanning 200K lines and 5,650 tests, no unsafe code.
Minisqlite is a from-scratch Rust implementation of SQLite's SQL dialect, query planner, executor, and storage engine, matching the official on-disk file format down to the byte level. It can open databases written by sqlite3 and produce files sqlite3 reads back correctly, including WAL mode, UTF-16 encodings, auto-vacuum, and overflow chains.
The project spans roughly 200,000 lines of Rust across 14 crates and 5,650 tests, with a single external dependency and no unsafe code in the library. The public API is deliberately minimal: one Connection type exposing open, open_in_memory, execute, and query.
Feature coverage is broad: joins, window functions, triggers, upsert, foreign key constraints, cross-database queries via ATTACH, PRAGMAs, and the JSON function family are all implemented. The architecture separates concerns cleanly across parser, planner, executor, b-tree, pager, WAL, and file-format layers, each isolated in its own crate.
For engineers, it offers a memory-safe, dependency-free alternative to linking against SQLite's C library while remaining byte-compatible with its file format — and serves as a concrete data point on how far Rust has matured for large-scale systems software.