esquel

Create mermaid diagrams from SQL scripts.

```sh USAGE: esquel [OPTIONS] --input

OPTIONS: -d, --dialect [default: generic] [possible values: ansi, clickhouse, generic, hive, mssql, mysql, postgres, sqlite, snowflake] -f, --flow Direction of the flowchart [default: tb] [possible values: tb, bt, rl, lr] -h, --help Print help information -i, --input Path to sql script or raw sql -o, --out Path to output file -V, --version Print version information ```

Uses all CREATE, INSERT, DELETE and UPDATE statements that reference other tables.

Example

The following SQL script

```sql create table foo as select * from bar;

create view baz as select * from foo inner join qux;

delete from foo where exists ( select 1 from qux where qux.fooid = foo.fooid ); ```

generates this flowchart:

mermaid graph TB A[bar] B[baz] C[foo] D[qux] A --> C C --> B D --> B D --> C

Installation

sh cargo install esquel