Install and load
Run these commands in a Haybarn SQL session. The extension is available from the community repository.
INSTALL petgraph_ext FROM community;
LOAD petgraph_ext FROM community;
Using upstream DuckDB? Follow the maintainer’s installation instructions.
Usage example
SELECT * FROM petgraph_shortest_path('[(0,1,2.5),(1,2,1.0),(0,2,5.0)]', 0, 2);
-- → [0,1,2] 3.5
Provided by alitrack. Not yet verified on Haybarn 2.0.0.
Sample data & setupAbout this extension
A DuckDB extension that brings graph algorithms into SQL, powered by the petgraph Rust crate. Run PageRank, betweenness centrality, closeness centrality, eigenvector centrality, SCC, Louvain community detection, topological sort, cycle detection, shortest path, connected components, and MST — no external graph database required.
Project overview from the community descriptor.
Documentation and resources
Project and build details
- Repository
- alitrack/duckdb_petgraph
- License
- MIT
- Maintainers
- alitrack
- Written in
- Rust
- Build source
75aadaf3fc97- Build definition
- Community descriptor