Skip to content

PocketDBA fast, embedded, single-file NoSQL document database for Rust

A fast, embedded NoSQL document database built entirely from scratch in Rust

PocketDB Logo

Quick Example ​

rust
use pocketdb::{Database, doc, filter};

fn main() -> pocketdb::Result<()> {
    let db = Database::open("mydata.pdb")?;
    let users = db.collection("users")?;

    // Insert a document
    let id = users.insert(doc! {
        "name" => "Alice",
        "age" => 30,
        "active" => true
    })?;

    // Query with filters
    let results = users.find(&filter! { "age" => > 18, "active" => == true });

    println!("Found {} users", results.len());
    Ok(())
}

Installation ​

Add to your Cargo.toml:

toml
[dependencies]
pocketdb = "0.1"

Or via the command line:

bash
cargo add pocketdb

Released under the MIT License. Built by Muhammad Fiaz.