sqlite-containers 2.0.0

SQLite-based containers for Rust
Documentation

SQLite-based containers for Rust

SQLite-based containers for Rust

sqlite-containers provides map and set implementations that are backed by SQLite in-memory databases. It is designed as a drop-in replacement for HashMap and HashSet. Leveraging the power of the SQLite engine, SQLiteMap and SQLiteSet efficiently store billions of elements!

Quick Start

This example demonstrates how to use SQLiteSet:

use sqlite_containers::SQLiteSet;
type SQLiteStringSet = SQLiteSet<String>;

let mut sqlite_set = SQLiteStringSet::new().unwrap();
let mut tx = sqlite_set.transaction().unwrap();

println!("Inserting elements, please wait...");

for n in 0..1_000_000u64 {
    tx.insert(&format!("{:016X}", n)).unwrap();
}

tx.commit();
println!("{} elements.", sqlite_set.len().unwrap());

Acknowledgement

This project is based on SQLite and the Rusqlite wrapper 😻

SQLite’s code and documentation are dedicated to the public domain.

Rusqlite is available under the MIT license.

License

“SQLite-based Containers for Rust” is published under the Unlicense.

∎