Embeddable property graph database with GQL query language, graph algorithms, and Python bindings
Project description
minigdb
An embedded property-graph database built in Rust on RocksDB. Property graph model (nodes and edges with labels and key-value properties), ACID-compliant RocksDB-backed storage, and a GQL (ISO/IEC 39075) query language subset — usable as a REPL, a network server, or an embedded Rust/Python library.
Feature highlights:
- GQL queries:
MATCH,INSERT,SET,DELETE, variable-length paths,OPTIONAL MATCH,UNION, aggregates,WITH,UNWIND - 15 built-in graph algorithms: PageRank, shortest path, community detection (Louvain/Leiden), centrality measures, max-flow, and more
- Property indexes with automatic pushdown for equality, range, and
startsWith()prefix queries; uniqueness and type constraints, parameterized queries, CSV bulk import - Multi-graph support, explicit transactions with O(ops-in-transaction) adjacency rollback
- TCP server with authentication, per-connection transaction isolation, and an embedded web GUI
- Python bindings via PyO3 with polars/pandas DataFrame output
Quick Start
Requires Rust (install via rustup).
# Build and launch the interactive REPL
cargo run
# Or build first, then run the binary directly
cargo build
./target/debug/minigdb
# Run the test suite
cargo test
Data is stored in the platform user-data directory:
| Platform | Path |
|---|---|
| Linux | ~/.local/share/minigdb/ |
| macOS | ~/Library/Application Support/minigdb/ |
| Windows | %AppData%\minigdb\ |
The REPL prints the active data directory on startup. Each named graph gets its own graphs/<name>/ subfolder.
REPL
The REPL auto-detects complete statements, so semicolons are optional. Multi-line input is supported; the prompt shows -> until the statement is complete (or txn-> inside a transaction). Input history is saved to .minigdb_history in the current directory.
Meta-commands
| Command | Effect |
|---|---|
:graphs |
List all graphs across all registered roots, marking the active one |
:create <name> |
Create a new named graph and switch to it |
:use <name> |
Checkpoint the current graph and switch to an existing one |
:drop <name> |
Permanently delete a named graph |
:checkpoint |
Force a snapshot and truncate the WAL immediately |
:locations |
List registered graph-root directories |
:add-location <path> |
Register an additional graph-root directory (persisted) |
:remove-location <path> |
Remove a registered graph-root directory (persisted) |
:quit or :q |
Exit (writes a final checkpoint) |
Ctrl-C |
Cancel the current input line |
Ctrl-D |
Exit |
Graph management commands are not allowed inside a BEGIN transaction.
Example queries
INSERT (:Person {name: "Alice", age: 30})
INSERT (:Person {name: "Bob", age: 25})
MATCH (a:Person {name: "Alice"}), (b:Person {name: "Bob"})
INSERT (a)-[:KNOWS]->(b)
MATCH (a)-[:KNOWS]->(b) RETURN a.name, b.name
CALL pageRank() YIELD node, score RETURN node, score ORDER BY score DESC
Documentation
| Topic | Description |
|---|---|
| Query Language | Full GQL reference: INSERT, MATCH, WHERE, aggregates, path quantifiers, indexes, constraints, transactions |
| Graph Algorithms | 15 algorithms invoked via CALL … YIELD: PageRank, shortest path, centrality, community detection, max-flow |
| Network Server | TCP server, authentication, web GUI, wire protocol, HTTP API |
| Python API | Installation, local/remote usage, DataFrame output, parameterized queries, CSV import |
Storage
Each named graph is stored in its own graphs/<name>/ subdirectory, backed by RocksDB using eight column families:
| Column Family | Contents |
|---|---|
nodes |
Node records (ID → bincode-serialized Node) |
edges |
Edge records (ID → bincode-serialized Edge) |
adj_out |
Outgoing adjacency index |
adj_in |
Incoming adjacency index |
label_idx |
Label → node ID set |
edge_label_idx |
Edge label → edge ID set |
prop_idx |
Property index (label + key + encoded value → node ID set) |
meta |
Graph metadata (index definitions, constraint definitions) |
RocksDB provides atomic writes via WriteBatch, crash recovery via SST compaction, and supports graphs that exceed available RAM through its internal block cache.
Architecture
src/
├── main.rs # REPL (rustyline, graph management commands, server entry points)
├── lib.rs # Public API and re-exports
├── gql.pest # PEG grammar (pest, read at compile time)
├── python.rs # Python bindings (PyO3, feature = "python")
├── csv_import.rs # CSV bulk import
├── types/ # Value, NodeId (ULID), EdgeId (ULID), Node, Edge, DbError
├── graph/ # Graph struct + RocksDB-backed mutation helpers (ops.rs, constraints.rs)
├── storage/ # RocksStore (8 CFs), StorageManager, apply_ops replay helper
├── transaction/ # Operation enum (WAL replay units)
├── algorithms/ # 15 graph algorithm modules dispatched via CALL
├── query/ # AST, pest parser, tree-walking executor
└── server/
├── mod.rs # Async TCP server, auth handshake, per-connection state
├── auth.rs # ServerConfig, UserEntry, SHA-256 password hashing
├── registry.rs # GraphRegistry — lazy-open, Arc<Mutex> per graph
├── protocol.rs # Request/Response/ClientMessage/ServerMessage types
└── http.rs # Axum HTTP server + embedded GUI (feature = "gui")
Cargo features
| Feature | Included in default | Description |
|---|---|---|
repl |
yes | Interactive REPL (rustyline, readline history) |
server |
yes | TCP server (tokio, SHA-256 auth) |
gui |
yes | Embedded HTTP GUI (axum); requires server |
python |
no | PyO3 Python bindings; build with maturin develop --features python |
License
minigdb is distributed under the GNU Lesser General Public License v3.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minigdb-0.1.2.tar.gz.
File metadata
- Download URL: minigdb-0.1.2.tar.gz
- Upload date:
- Size: 305.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8278db0b59abc2cefb997564d2116a1051d9102156e4d25cb0aa586dea7668a8
|
|
| MD5 |
5c7dabd23f99b998664653c094d95cd2
|
|
| BLAKE2b-256 |
d1b1f355644717c46809255777e913d4eb36a46cb92e17199a657548eaa92b52
|
Provenance
The following attestation bundles were made for minigdb-0.1.2.tar.gz:
Publisher:
release.yml on jerichomcleod/minigdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minigdb-0.1.2.tar.gz -
Subject digest:
8278db0b59abc2cefb997564d2116a1051d9102156e4d25cb0aa586dea7668a8 - Sigstore transparency entry: 1195956722
- Sigstore integration time:
-
Permalink:
jerichomcleod/minigdb@2fe2a8d53c43928209bebd9bbeba0cb25bf85c79 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jerichomcleod
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2fe2a8d53c43928209bebd9bbeba0cb25bf85c79 -
Trigger Event:
push
-
Statement type:
File details
Details for the file minigdb-0.1.2-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: minigdb-0.1.2-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
589cb960fe9ed8458dfb512e3792ef363fb3625ef7c0849dc070a0854dc3bc1e
|
|
| MD5 |
0c1c84efef6f8ade151f01a21c483e41
|
|
| BLAKE2b-256 |
52bbde7772b0350878785d71b28564497cd9d36eb6d44eb55b5e020243bd464d
|
Provenance
The following attestation bundles were made for minigdb-0.1.2-cp39-abi3-win_amd64.whl:
Publisher:
release.yml on jerichomcleod/minigdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minigdb-0.1.2-cp39-abi3-win_amd64.whl -
Subject digest:
589cb960fe9ed8458dfb512e3792ef363fb3625ef7c0849dc070a0854dc3bc1e - Sigstore transparency entry: 1195956783
- Sigstore integration time:
-
Permalink:
jerichomcleod/minigdb@2fe2a8d53c43928209bebd9bbeba0cb25bf85c79 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jerichomcleod
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2fe2a8d53c43928209bebd9bbeba0cb25bf85c79 -
Trigger Event:
push
-
Statement type:
File details
Details for the file minigdb-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: minigdb-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c27ad5cd06ff42745628d11ac81eeed793e1286127af3842c728147a6d8af54e
|
|
| MD5 |
ebb451791e8bf198fe5919fab963ecc9
|
|
| BLAKE2b-256 |
54f7d705e4829683460f61a54b2f7c461b92c643e92753cf7b432eb4c16f9c43
|
Provenance
The following attestation bundles were made for minigdb-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on jerichomcleod/minigdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minigdb-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
c27ad5cd06ff42745628d11ac81eeed793e1286127af3842c728147a6d8af54e - Sigstore transparency entry: 1195956745
- Sigstore integration time:
-
Permalink:
jerichomcleod/minigdb@2fe2a8d53c43928209bebd9bbeba0cb25bf85c79 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jerichomcleod
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2fe2a8d53c43928209bebd9bbeba0cb25bf85c79 -
Trigger Event:
push
-
Statement type:
File details
Details for the file minigdb-0.1.2-cp39-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: minigdb-0.1.2-cp39-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79e6d8b6baa51d3a8d790a0ac64e73024691f7ea831473ed5f17bc9079b55f3e
|
|
| MD5 |
3c9dbbc9449f6aee80ef7b6429f4cd86
|
|
| BLAKE2b-256 |
e1f69111f602c1cbe3ade4125a800484b29ec55a69f492589693c44d8010bb60
|
Provenance
The following attestation bundles were made for minigdb-0.1.2-cp39-abi3-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on jerichomcleod/minigdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minigdb-0.1.2-cp39-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
79e6d8b6baa51d3a8d790a0ac64e73024691f7ea831473ed5f17bc9079b55f3e - Sigstore transparency entry: 1195956775
- Sigstore integration time:
-
Permalink:
jerichomcleod/minigdb@2fe2a8d53c43928209bebd9bbeba0cb25bf85c79 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jerichomcleod
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2fe2a8d53c43928209bebd9bbeba0cb25bf85c79 -
Trigger Event:
push
-
Statement type:
File details
Details for the file minigdb-0.1.2-cp39-abi3-macosx_10_13_x86_64.macosx_11_0_arm64.macosx_10_13_universal2.whl.
File metadata
- Download URL: minigdb-0.1.2-cp39-abi3-macosx_10_13_x86_64.macosx_11_0_arm64.macosx_10_13_universal2.whl
- Upload date:
- Size: 6.9 MB
- Tags: CPython 3.9+, macOS 10.13+ universal2 (ARM64, x86-64), macOS 10.13+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3fd31586a223532e24432efd6691e237b43c60c43fb6e1580ba0ffd953fbfc8
|
|
| MD5 |
3f3590c32629b1e0da6f9deb83220662
|
|
| BLAKE2b-256 |
d56eb62f91a4802aab83163a516f7d0e281c95ea91f99f8fee493d9dd58aae2f
|
Provenance
The following attestation bundles were made for minigdb-0.1.2-cp39-abi3-macosx_10_13_x86_64.macosx_11_0_arm64.macosx_10_13_universal2.whl:
Publisher:
release.yml on jerichomcleod/minigdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minigdb-0.1.2-cp39-abi3-macosx_10_13_x86_64.macosx_11_0_arm64.macosx_10_13_universal2.whl -
Subject digest:
a3fd31586a223532e24432efd6691e237b43c60c43fb6e1580ba0ffd953fbfc8 - Sigstore transparency entry: 1195956760
- Sigstore integration time:
-
Permalink:
jerichomcleod/minigdb@2fe2a8d53c43928209bebd9bbeba0cb25bf85c79 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jerichomcleod
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2fe2a8d53c43928209bebd9bbeba0cb25bf85c79 -
Trigger Event:
push
-
Statement type: