HeadlinesBriefing HeadlinesBriefing.com

Minigraf: Embedded bi-temporal graph database in Rust

Hacker News •
×

Minigraf is a tiny, self-contained embedded graph database with Datalog queries and bi-temporal time travel. Think SQLite, but for connected data with full history. It is a single-file embedded graph database that lets you query relationships with Datalog, time travel through history via bi-temporal queries (transaction time + valid time), use window functions like sum/count/min/max/avg/rank/row-number, prepare statements with $slot bind tokens, embed anywhere (native, WASM, mobile, IoT) with one .graph file, and requires zero configuration.

Datalog is fundamentally better for graphs than SQL-like languages: recursive by design, simpler to implement, perfect for temporal data, proven at scale (40+ years of research, production use at Datomic, XTDB), graph-native with facts as edges, and LLM-friendly with small uniform grammar.

Installation: Add `minigraf = "2.0.2"` to dependencies or use Cargo. Requires Rust 1.89 or newer. Known issues include a bug where two values of the same attribute for one entity written in a single transact can read back as one value (#371); fix ships in v3.0.0.

Quick Start: Open a database with `Minigraf::open("data.graph")`, add facts via `transact`, query with Datalog, use explicit transactions, time travel with `:as-of`, define recursive rules with `rule`, and use prepared statements for repeated execution.

Source: Hacker News · Summarized by HeadlinesBriefing