Crates.io | visualize-sqlite |
lib.rs | visualize-sqlite |
version | 2.0.0 |
source | src |
created_at | 2021-07-01 15:35:17.910556 |
updated_at | 2022-08-29 18:14:48.51407 |
description | A simple way to draw a diagram from an sqlite database |
homepage | |
repository | https://github.com/PaulAvery/visualize-sqlite |
max_upload_size | |
id | 417497 |
size | 320,338 |
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);
}