Tool to automate the visualisation of UML dependencies from a SQL file

Overview

doteur-starsdoteur-licensegithub-issuescrates-dldocker-build

Doteur

A simple tool to draw your mysql relations from exports.

Help us

If you use the tool, and like it, don't forget to add a star to the project on GitHub , it helps us to keep motivation to improve it.

If you have any suggestion, or issue, please report it, it will help us to fix them.

General information

How to use through Docker

To download the tool

docker pull nag763/doteur:latest

Then to use it, simply pass a folder with your sql files, and be careful to write all your outputs in the shared folder to ensure the files are available on your host machine once the image is destroyed.

docker run --rm -v ${PATH_TO_YOUR_SQL_FOLDER}:/usr/src/doteur/shared -it nag763/doteur:latest bash

How to install it natively

  1. Optional but highly recommended

First install graphviz.

On Linux, use your default package manager.

Example on ubuntu :

usr@ubuntu:~$ sudo apt-get install graphviz

On Windows, use winget or the default graphviz installer.

You can still refer to the graphviz download page.

The tool uses graphviz libraries to render in other formats than .dot, if graphviz is not installed or you do not want to install it, you can still use this tool and pass it your output file.

  1. Download the tool
  • Via cargo
cargo install doteur
cargo install --git https://github.com/nag763/doteur
  1. Use the tool
doteur --help
  1. Add it to your path

If you need to use it regularly, it is recommended to add the bin folder to your path. For this, look on how to do it on your distro.

On linux :

ln -s path/to/doteur /usr/sbin

Cli usage

usr@linux:~$ doteur --help
doteur 0.3.2
LABEYE Loïc
Convert .sql files to .dot files

USAGE:
    doteur [FLAGS] [OPTIONS] <input>...

FLAGS:
        --dark-mode    Render in dark mode
    -h, --help         Prints help information
    -V, --version      Prints version information

OPTIONS:
    -x, --exclude <exclude>...    Exclude the given tables
    -i, --include <include>...    Include only the given tables
    -o, --output <output>         The output filename

ARGS:
    <input>...    Name of the sql file, can also be a directory or several files

Example usage

Export a .sql file to a .dot
usr@pop-os:~$ doteur sample.sql

The output will be in the output.dot

Export a .sql file to a .png
usr@pop-os:~$ doteur sample.sql -o output.png

The output will be in a png file.

For the format supported, please refer to the graphviz documentation

Export a .sql file to a .png, render in dark mode
usr@pop-os:~$ doteur sample.sql -o output.png -x hello* --dark-mode
Export a .sql file to a .png, include only tables who have either the name hello or world
usr@pop-os:~$ doteur sample.sql -o output.png -i hello world
Export a .sql file to a .png, include only tables who starts with the name hello
usr@pop-os:~$ doteur sample.sql -o output.png -i hello*
Export a .sql file to a .png, exclude all tables who starts with the name hello
usr@pop-os:~$ doteur sample.sql -o output.png -x hello*
You might also like...
Running SQL-like queries on files.

filesql Running SQL-like queries on files. Features Supported: REPL Basic SQL expressions. INSERT clause. (which inserts data into another file) WHERE

Fully typed SQL query builder for Rust [deprecated]

What is Deuterium? Deuterium is a fancy SQL builder for Rust. It's designed to provide a DSL to easily build SQL queries in safe and typed way. Like R

Ormlite - An ORM in Rust for developers that love SQL.

ormlite ormlite is an ORM in Rust for developers that love SQL. It provides the following, while staying close to SQL, both in syntax and performance:

Distributed SQL database in Rust, written as a learning project

toyDB Distributed SQL database in Rust, written as a learning project. Most components are built from scratch, including: Raft-based distributed conse

Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres.

SDB - SignatureDB Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres

X-Engine: A SQL Engine built from scratch in Rust.

XNGIN (pronounced "X Engine") This is a personal project to build a SQL engine from scratch. The project name is inspired by Nginx, which is a very po

Rust library to parse, deparse and normalize SQL queries using the PostgreSQL query parser

This Rust library uses the actual PostgreSQL server source to parse SQL queries and return the internal PostgreSQL parse tree.

RisingWave is a cloud-native streaming database that uses SQL as the interface language.

RisingWave is a cloud-native streaming database that uses SQL as the interface language. It is designed to reduce the complexity and cost of building real-time applications. RisingWave consumes streaming data, performs continuous queries, and updates results dynamically. As a database system, RisingWave maintains results inside its own storage and allows users to access data efficiently.

Type-safe SQL query wrappers

fnsql   The fnsql crate provides simple type-safe optional wrappers around SQL queries. Instead of calling type-less .query() and .execute(), you call

Comments
  • `doteur` panics if table-name is wrapped by double-quotations

    `doteur` panics if table-name is wrapped by double-quotations

    Describe the bug A clear and concise description of what the bug is. doteur can successfully compile the following command:

    ``` test.sql
    CREATE TABLE my_table_name ( ... );
    ```
    

    but the following will throw an error:

    ``` test.sql
    CREATE TABLE "my_table_name" ( ... );
    ```
    

    doteur, however, does NOT panic if column-names are wrapped in double-quotations. i.e., doteur will successfully compile the following (even though the column-name is wrapped in double-quotations):

    ``` test.sql
    CREATE TABLE my_table_name (
        "my_column" INT
    );
    ```
    

    It seems that the panic only happens when the TABLE-NAME is wrapped in double-quotes...

    To Reproduce Steps to reproduce the behavior:

    1. create a test.sql file
    2. write: CREATE TABLE "my_table_name" ( "id" INT );
    3. the above will fail, but if you change it to: CREATE TABLE my_table_name ( "id" INT ); if will compile and produce an output

    Expected behavior doteur should not panic if a table-name is wrapped with double-quotations.

    Desktop (please complete the following information):

    • OS: macOS
    enhancement question 
    opened by raunakab 8
Releases(0.5.3)
Owner
Loïc
Loïc, 24ans, ingénieur.
Loïc
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.

SQLx ?? The Rust SQL Toolkit Install | Usage | Docs Built with ❤️ by The LaunchBadge team SQLx is an async, pure Rust† SQL crate featuring compile-tim

launchbadge 7.6k Dec 31, 2022
A Rust SQL query builder with a pleasant fluent API closely imitating actual SQL

Scooby An SQL query builder with a pleasant fluent API closely imitating actual SQL. Meant to comfortably build dynamic queries with a little bit of s

Aleksei Voronov 100 Nov 11, 2022
Gh-sql - Query GitHub Projects (beta) with SQL

gh-sql: Query GitHub Projects (beta) with SQL Installation gh extension install KOBA789/gh-sql Features SELECT items DELETE items UPDATE item fields

Hidekazu Kobayashi 108 Dec 7, 2022
Znapper is a tool to help automate zfs snapshot management on larger pools

Znapper is a tool to help automate zfs snapshot management on larger pools. This is similar to zfs-auto-snap, but goes a bit further to help manage snapshots over replicated pools for backups within a single host.

Firstyear 2 Feb 11, 2022
TDS 7.2+ (mssql / Microsoft SQL Server) async driver for rust

Tiberius A native Microsoft SQL Server (TDS) client for Rust. Supported SQL Server versions Version Support level Notes 2019 Tested on CI 2017 Tested

Prisma 189 Dec 25, 2022
Query LDAP and AD with SQL

SQLDAP Ever wanted to query AD or LDAP with SQL like queries ? I'm going to answer this question myself: yes ! Why ? Because I never could remember al

null 9 Nov 15, 2022
FeOphant - A SQL database server written in Rust and inspired by PostreSQL.

A PostgreSQL inspired SQL database written in Rust.

Christopher Hotchkiss 27 Dec 7, 2022
GlueSQL is a SQL database library written in Rust

GlueSQL is a SQL database library written in Rust. It provides a parser (sqlparser-rs), execution layer, and optional storage (sled) packaged into a single library.

GlueSQL 2.1k Jan 8, 2023
An object-relational in-memory cache, supports queries with an SQL-like query language.

qlcache An object-relational in-memory cache, supports queries with an SQL-like query language. Warning This is a rather low-level library, and only p

null 3 Nov 14, 2021
Run SQL queries on CSV files

zsql run SQL queries on csv files A terminal utility to easily run SQL queries on CSV files. zsql is shipped as a small single binary powered by rust

Zizaco 9 Jul 9, 2022