Minigraf: an embedded graph database with Datalog and bi-temporal queries

Hi everyone,

I’ve built Minigraf, a small, single-file embedded graph database written in Rust.

Minigraf stores connected data as facts and queries it with Datalog. It also tracks both transaction time and valid time, so you can ask what the database recorded at a particular point, or what it believed was true at a point in the past.


use minigraf::{Minigraf, OpenOptions};

let db = OpenOptions::new().path("data.graph").open()?;
db.execute(r#"(transact [[:alice :friend :bob]])"#)?;

let results = db.execute(
    r#"(query [:find ?friend :where [:alice :friend ?friend]])"#
)?;

Version 2.0.2 improves selective lookups and checkpoint performance, fixes several query and durability issues, and is the final planned release on the v2.x line. It’s available with cargo add minigraf; the crate requires Rust 1.89 or newer.

A caveat for anyone evaluating v2.x: there’s a known issue with writing multiple values for the same attribute in one transaction. The known issues list includes the workaround and affected versions.

I’d be glad to hear how the Datalog and bi-temporal model fits your use cases, and where the API or documentation could be clearer.