Crates.io | sql_mermaid_visualizer |
lib.rs | sql_mermaid_visualizer |
version | 0.1.0 |
source | src |
created_at | 2022-02-05 00:34:33.670244 |
updated_at | 2022-02-05 00:34:33.670244 |
description | A very simple tool written in Rust that takes PostgreSQL database files and generates a [Mermaid](https://mermaid-js.github.io/mermaid) entity relationship diagram. |
homepage | |
repository | https://github.com/CoBrooks/sql_mermaid_visualizer |
max_upload_size | |
id | 527191 |
size | 23,509 |
A very simple tool written in Rust that takes PostgreSQL database files and generates a Mermaid entity relationship diagram.
This project is published to crates.io and thus can be installed using
$ cargo install sql_mermaid_visualizer
If you do not have cargo, the installation steps can be found here
USAGE:
sqlvis [OPTIONS] --file <FILE>
OPTIONS:
-f, --file <FILE>
-h, --help Print help information
-o, --output-file <OUTPUT_FILE>
-V, --version Print version information
To print the Mermaid representation of the ./examples/simple.sql example
to stdout
:
$ sqlvis -f ./examples/simple.sql
Sample output of the above command:
erDiagram
Student {
INT StudentId
INT ParentId
VARCHAR30 Name
INT Age
VARCHAR25 Address
VARCHAR20 Phone
}
Parent {
INT ParentId
INT StudentId
INT PartnerId
VARCHAR30 Name
VARCHAR25 Address
VARCHAR20 Phone
}
Student ||--|{ Parent : "FK_StudentParentId"
Parent ||--|{ Student : "FK_ParentStudentId"
Parent ||--|{ Parent : "FK_ParentPartnerId"
To output the Mermaid representation of the ./examples/big.sql example
into ./big.md
:
$ sqlvis -f ./examples/big.sql -o ./big.md