spanner-er
is a command-line tool to generate ER diagram from DDL schama file.
spanner-er
depends on graphviz.
Install graphviz on your host platform.
brew install graphviz
or
apk add --no-cache graphviz ttf-freefont
or
apt-get update && apt-get install graphviz
Install spanner-er
go get -u github.com/nktks/spanner-er
you can use docker image
docker run --rm -v `pwd`:/go/src/github.com/nktks/spanner-er --workdir="/go/src/github.com/nktks/spanner-er" ghcr.io/nktks/spanner-er -h
or
git clone git@github.com:nktks/spanner-er.git
cd ./spanner-er
./scripts/spanner-er-docker.sh -h
In this case, you should use relative path for -s
, -o
option.
spanner-er -h
Usage:
-T string
output file type. default is png(pass to dot option -T) (default "png")
-h print help
-o string
output file name.default is spanner_er.<type>(pass to dot option -o)
-s string
spanner schema file