This is the Go implementation of simple-graph.
- SQLite, version 3.31.0 or higher; get the latest source or precompiled binaries from the SQLite Download Page
- Go
- go-sqlite3
go get github.com/mattn/go-sqlite3
- go-graphviz for visualizations
go get github.com/goccy/go-graphviz
- Optionally, or if the statements in the [originating sql folder (https://github.com/dpapathanasiou/simple-graph/tree/main/sql) change, run the constants generation script to rebuild the
constants.go
file./generate-constants.sh
The database package provides convenience functions for atomic transactions to add, delete, connect, and search for nodes.
There are also visualization functions to convert search and traversal outputs into dot format for conversion images.
There are unit tests in the simplegraph
package covering each of the basic functions.
Make sure to use the json1
tags when running them:
cd simplegraph
go test -tags json1
If you have the correct version of SQLite installed, the tests should all pass:
PASS
ok github.com/dpapathanasiou/simple-graph/go/simplegraph 0.067s