#sqlite #minimalist #tiny #api #variant #version #amalgamation

sqlite-tiny

A minimalistic SQLite crate which ships the amalgamation variant and provides a tiny Rust API

13 releases (5 breaking)

0.6.3 Feb 24, 2025
0.6.1 Jan 2, 2025
0.6.0 Dec 6, 2024
0.5.0 Aug 19, 2024
0.1.1 Feb 19, 2024

#573 in Database interfaces

Download history 41/week @ 2024-11-27 407/week @ 2024-12-04 165/week @ 2024-12-11 25/week @ 2024-12-18 15/week @ 2024-12-25 166/week @ 2025-01-01 89/week @ 2025-01-08 109/week @ 2025-01-29 20/week @ 2025-02-05 1/week @ 2025-02-12 94/week @ 2025-02-19 39/week @ 2025-02-26

162 downloads per month

BSD-2-Clause OR MIT

9.5MB
180K SLoC

C 177K SLoC // 0.3% comments Rust 3K SLoC // 0.0% comments

License BSD-2-Clause License MIT AppVeyor CI docs.rs crates.io Download numbers dependency status

sqlite-tiny

Welcome to sqlite-tiny 🎉

This crate is minimalistic SQLite library crate which ships the amalgamation variant and provides a tiny Rust API. If you just want the embedded SQLite library plus the generated C bindings, you can disable the api-feature (enabled by default).

Performance Considerations

For the sake of simplicity, this crate operates under the following assumption: malloc is cheap. To keep the code clean and readable, we are quite liberal with allocating memory and copying data to avoid overly complex life-time juggling.

Some locations where we do this are (non-exhaustive):

  • Binding values: Since some values require a temporary intermediate representation before they can be bound, and statements should be able to outlive a passed argument, we instruct SQLite to copy the values into an internal buffer
  • Reading values: To avoid lifetime troubles, we always copy a value from a row/column out of the SQLite context into Rust-managed memory immediately on access

Distriuted SQLite Version

For simplicity, this crate does not link to external SQLite versions, but exclusively builds and embeds the amalgamation in the dist-folder. For more information see dist/README.md.

No runtime deps