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
If you have any suggestion, or issue, please report it, it will help us to fix them.
General information
- Author : LABEYE Loïc
- Licence : MIT
- Official website : https://doteur.net
- Platforms available :
- Linux
- Tested
- Windows
- Tested
- Linux
- Github : https://github.com/nag763/doteur
- crates.io : https://crates.io/crates/doteur
- Docker image, continuous delivery : https://hub.docker.com/r/nag763/doteur
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
- 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.
- Download the tool
- Via cargo
cargo install doteur
-
Via the release page
-
Via the official website
-
Via github
cargo install --git https://github.com/nag763/doteur
- Use the tool
doteur --help
- 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*