sqliteviz

command module
v0.0.0-...-c253463 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2022 License: ISC Imports: 11 Imported by: 0

README

SQLiteViz

Go application that creates simple diagrams in .dot, .png or .svg from your SQLite database schemas using Graphviz.

Installation:

go install github.com/n0x1m/sqliteviz@latest

Usage, provided graphviz is installed:

Usage of ./sqliteviz:
  -db string
        sqlite database path
  -ignore value
        tables to ignore
  -out string
        output file to write to write to
  -template string
        template file to use (default "diagram.tpl.dot")

Examples

# to dotfile
sqliteviz db.sqlite3 > output.dot
# to png
sqliteviz db.sqlite3 | dot -Tpng > output.png
# to svg
sqliteviz db.sqlite3 | dot -Tsvg > output.svg
# using flags and with ignore list
sqliteviz -db db.sqlite3 -ignore schema_migrations,sqlite_stat1 > output.dot

Example

Chinook is a sample database available for SQLite and other databases. It's an alternative to the Northwind database and is meant for demos and testing ORM tools. It can be created by running a single SQL script. The following sample was generated against Chinook with:

sqliteviz -db chinook.db -ignore schema_migrations,sqlite_stat1 > example/chinook.dot
sqliteviz -db chinook.db -ignore schema_migrations,sqlite_stat1 | dot -Tsvg > example/chinook.svg

sqlite visualization of the chinook database

See the corresponding Graphviz dot file that was generated.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL