Skip to main content

Crate sqlite_containers

Crate sqlite_containers 

Source
Expand description

§SQLite-based containers for Rust

sqlite-containers provides hash set and hash map implementations that are backed by SQLite in-memory databases.

Leveraging the power of the SQLite engine, these containers can efficiently store billions of elements.

§Quick Start

This example demonstrates how to use SQLiteSet:

use sqlite_containers::SQLiteSet;

let mut sqlite_set = SQLiteSet::new().expect("Failed to create SQLiteSet!");
let mut tx = sqlite_set.transaction().expect("Failed to init transaction!");

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

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

tx.commit();
println!("{} element(s) successfully inserted.", sqlite_set.len().unwrap());

§Acknowledgement

This project is based on the SQLite library and the Rusqlite wrapper for Rust 😻

§License

The “SQLite-based Containers for Rust” project is released under the Unlicense.

Re-exports§

pub use rusqlite;

Structs§

Error
Indicates that the operation failed due to an SQLite error.
SQLiteMap
A hash map with string keys and values, backed by an SQLite in-memory database.
SQLiteMapTransaction
Represents an active SQLite transaction for a SQLiteMap.
SQLiteSet
A hash set with string keys, backed by an SQLite in-memory database.
SQLiteSetTransaction
Represents an active SQLite transaction for a SQLiteSet.

Type Aliases§

SizeT
The “size” type used by len(), equal to usize on this platform.