esquel

Crates.ioesquel
lib.rsesquel
version0.1.2
sourcesrc
created_at2022-03-17 16:01:05.101762
updated_at2022-04-09 12:11:10.815388
descriptioncreate mermaid charts from sql scripts
homepage
repositoryhttps://github.com/xrestorff/esquel
max_upload_size
id551884
size18,909
(xorsterff)

documentation

README

esquel

Create mermaid diagrams from SQL scripts.

USAGE:
    esquel [OPTIONS] --input <INPUT>

OPTIONS:
    -d, --dialect <DIALECT>    [default: generic] [possible values: ansi, clickhouse, generic, hive,
                               mssql, mysql, postgres, sqlite, snowflake]
    -f, --flow <FLOW>          Direction of the flowchart [default: tb] [possible values: tb, bt,
                               rl, lr]
    -h, --help                 Print help information
    -i, --input <INPUT>        Path to sql script or raw sql
        --no-icons             Do not show icons
    -o, --out <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

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.foo_id = foo.foo_id
);

generates this flowchart:

graph TB
    A[bar]
    B[fa:fa-eye baz]
    C[fa:fa-table foo]
    D[qux]
    A --> C
    C --> B
    D --> B
    D --> C

Installation

cargo install esquel
Commit count: 0

cargo fmt