SQL Database Mermaid Visualizer

A very simple tool written in Rust that takes PostgreSQL database files and generates a Mermaid entity relationship diagram.

Installation

This project is published to crates.io and thus can be installed using bash $ cargo install sql_mermaid_visualizer If you do not have cargo, the installation steps can be found here

Usage

```bash USAGE: sqlvis [OPTIONS] --file

OPTIONS: -f, --file -h, --help Print help information -o, --output-file -V, --version Print version information ```

Example

To print the Mermaid representation of the ./examples/simple.sql example to stdout: bash $ sqlvis -f ./examples/simple.sql

Sample output of the above command: ```md 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 : "FKStudentParentId" Parent ||--|{ Student : "FKParentStudentId" Parent ||--|{ Parent : "FK_ParentPartnerId" ```

To output the Mermaid representation of the ./examples/big.sql example into ./big.md: bash $ sqlvis -f ./examples/big.sql -o ./big.md