visualize-sqlite

Crates.iovisualize-sqlite
lib.rsvisualize-sqlite
version2.0.0
sourcesrc
created_at2021-07-01 15:35:17.910556
updated_at2022-08-29 18:14:48.51407
descriptionA simple way to draw a diagram from an sqlite database
homepage
repositoryhttps://github.com/PaulAvery/visualize-sqlite
max_upload_size
id417497
size320,338
Florian Albertz (UhhhWaitWhat)

documentation

README

Visualize an sqlite database

Create simple visualizations of sqlite databases in GraphViz dot format.

This version only works with the 2.0 version of diesel. Use version 1.x of this crate if you need compatibility with an older diesel version.

CLI

visualize-sqlite your_sqlite_database.db | dot -Tpng -Gfontname='Fira Mono' -Gfontcolor='#586e75' -Gbgcolor='#fdf6e3' -Nfontname='Fira Mono' -Nfontcolor='#586e75' -Efontname='Fira Mono' > output.png

API

use diesel::SqliteConnection;
use visualize_sqlite::Schema;

fn main() {
    let db = SqliteConnection::establish("your_sqlite_database.db").unwrap();
    let dot_input = Schema::load(&mut db).unwrap();

    println!("{}", dot_input);
}

Sample Output

Sample Output

Commit count: 6

cargo fmt