sqlite-tiny

Crates.iosqlite-tiny
lib.rssqlite-tiny
version0.5.0
sourcesrc
created_at2024-02-19 00:11:41.299474
updated_at2024-08-19 20:05:00.079074
descriptionA minimalistic SQLite crate which ships the amalgamation variant and provides a tiny Rust API
homepage
repositoryhttps://github.com/KizzyCode/sqlite-tiny-rust
max_upload_size
id1144543
size9,861,952
Keziah Biermann (KizzyCode)

documentation

README

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.

Commit count: 13

cargo fmt