Awesome
About
This is the Go implementation of simple-graph.
Usage
Installation
- 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
Basic Functions
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.
Testing
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