All Projects → sue445 → plant_erd

sue445 / plant_erd

Licence: MIT license
ERD exporter with PlantUML and mermaid format

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to plant erd

ecto erd
A mix task for generating Entity Relationship Diagram from Ecto schemas available in your project.
Stars: ✭ 173 (+37.3%)
Mutual labels:  plantuml, erd, mermaid
Entityframework.exceptions
Handle database errors easily when working with Entity Framework Core. Supports SQLServer, PostgreSQL, SQLite, Oracle and MySql
Stars: ✭ 266 (+111.11%)
Mutual labels:  oracle, sqlite3
json-sql-builder2
Level Up Your SQL-Queries
Stars: ✭ 59 (-53.17%)
Mutual labels:  oracle, sqlite3
Mormot
Synopse mORMot ORM/SOA/MVC framework
Stars: ✭ 607 (+381.75%)
Mutual labels:  oracle, sqlite3
Markdown Preview Enhanced
One of the 'BEST' markdown preview extensions for Atom editor!
Stars: ✭ 3,478 (+2660.32%)
Mutual labels:  plantuml, mermaid
Asciidocfx
Asciidoc Editor and Toolchain written with JavaFX 16 (Build PDF, Epub, Mobi and HTML books, documents and slides)
Stars: ✭ 1,533 (+1116.67%)
Mutual labels:  plantuml, mermaid
Openrecord
Make ORMs great again!
Stars: ✭ 474 (+276.19%)
Mutual labels:  oracle, sqlite3
Dbeaver
Free universal database tool and SQL client
Stars: ✭ 23,752 (+18750.79%)
Mutual labels:  oracle, erd
Soci
Official repository of the SOCI - The C++ Database Access Library
Stars: ✭ 960 (+661.9%)
Mutual labels:  oracle, sqlite3
Sqlcheck
Automatically identify anti-patterns in SQL queries
Stars: ✭ 2,062 (+1536.51%)
Mutual labels:  oracle, sqlite3
Rom Sql
SQL support for rom-rb
Stars: ✭ 169 (+34.13%)
Mutual labels:  oracle, sqlite3
vuepress-theme-cool
A custom vuepress theme with mermaid and plantuml, katex and vue components.
Stars: ✭ 57 (-54.76%)
Mutual labels:  plantuml, mermaid
vue-showdowns-editor
A markdown editor using codemirror and previewer using @jhuix/showdowns for Vue.js.
Stars: ✭ 27 (-78.57%)
Mutual labels:  plantuml, mermaid
erdiagram
Entity-Relationship diagram code generator library
Stars: ✭ 28 (-77.78%)
Mutual labels:  oracle, plantuml
Ezsql
PHP class to make interacting with a database ridiculusly easy
Stars: ✭ 804 (+538.1%)
Mutual labels:  oracle, sqlite3
typeorm-uml
Generate Entity Relationship diagrams for Typeorm powered projects.
Stars: ✭ 207 (+64.29%)
Mutual labels:  plantuml, erd
index shotgun
duplicate index checker 🔥 🔫 👮
Stars: ✭ 35 (-72.22%)
Mutual labels:  oracle, sqlite3
sqlite-gui
Lightweight SQLite editor for Windows
Stars: ✭ 151 (+19.84%)
Mutual labels:  sqlite3
turkiye-il-ilce-sokak-mahalle-veri-tabani
https://adres.nvi.gov.tr/ adresinde yer alan tüm İl - İlçe - Mahalle / Köy / Mezra / Mevki - CSBM bilgilerini içeren veri tabanları (PostgreSQL, MariaDB / MySQL, MongoDB, Sqlite ve Redis)
Stars: ✭ 71 (-43.65%)
Mutual labels:  sqlite3
Malicious-Urlv5
A multi-layered and multi-tiered Machine Learning security solution, it supports always on detection system, Django REST framework used, equipped with a web-browser extension that uses a REST API call.
Stars: ✭ 35 (-72.22%)
Mutual labels:  sqlite3

PlantERD

ERD exporter with PlantUML and mermaid format

Build Status Build Status Coverage Status Maintainability Go Report Card

Example (PlantUML)

$ ./plant_erd sqlite3 --database /path/to/test_db.sqlite3

entity articles {
  * id : integer
  --
  * user_id : integer
  --
  index_user_id_on_articles (user_id)
}

entity users {
  * id : integer
  --
  name : text
}

articles }-- users

example-plantuml

Example (mermaid)

$ ./plant_erd sqlite3 --database /path/to/test_db.sqlite3 --format=mermaid --show-comment

erDiagram

articles {
  INTEGER id PK
  INTEGER user_id FK
}

users {
  INTEGER id PK
  TEXT name
}

users ||--o{ articles : owns
erDiagram

articles {
  INTEGER id PK
  INTEGER user_id FK
}

users {
  INTEGER id PK
  TEXT name
}

users ||--o{ articles : owns

Features

  • Output ERD from real database
  • Output ERD to stdout or file
  • Output only tables within a certain distance adjacent to each other with foreign keys from a specific table

Supported databases

  • SQLite3
  • MySQL: 5.6, 5.7, 8
  • PostgreSQL: 9, 10, 11, 12, 13, 14
  • Oracle

Supported output formats

Setup

Download latest binary from https://github.com/sue445/plant_erd/releases and chmod 755

  • plant_erd : for SQLite3, MySQL and PostgreSQL
  • plant_erd-oracle : for Oracle

Setup for plant_erd-oracle

plant_erd-oracle requires Basic Package or Basic Light Package in Oracle Instant Client

Example (Linux)

mkdir -p /opt/oracle
wget --quiet --tries=0 https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip
unzip -q instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip -d /opt/oracle
export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_3

# for Ubuntu
apt-get update
apt-get install -y libaio1

Example (Mac)

See https://github.com/kubo/ruby-oci8/blob/master/docs/install-on-osx.md and install instantclient-basic or instantclient-basiclite

Example (Windows)

  1. Go to https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html
  2. Download instantclient-basic-windows.x64-19.5.0.0.0dbru.zip or instantclient-basiclite-windows.x64-19.5.0.0.0dbru.zip
  3. Extract zip
  4. Move plant_erd-oracle to same directory as oci.dll

Usage

SQLite3

$ ./plant_erd sqlite3 --help
NAME:
   plant_erd sqlite3 - Generate ERD from sqlite3

USAGE:
   plant_erd sqlite3 [command options] [arguments...]

OPTIONS:
   -d DISTANCE, --distance DISTANCE  Output only tables within a certain DISTANCE adjacent to each other with foreign keys from a specific table (default: 0)
   --database DATABASE               SQLite3 DATABASE file
   -f FILE, --file FILE              FILE for output (default: stdout)
   --format value                    Output format (plant_uml, mermaid. default:plant_uml)
   -i, --skip-index                  Whether don't print index to ERD. This option is used only --format=plant_uml
   -s value, --skip-table value      Skip generating table by using regex patterns
   --show-comment                    Show column comment. This option is used only --format=mermaid
   -t TABLE, --table TABLE           Output only tables within a certain distance adjacent to each other with foreign keys from a specific TABLE

MySQL

$ ./plant_erd mysql --help
NAME:
   plant_erd mysql - Generate ERD from mysql

USAGE:
   plant_erd mysql [command options] [arguments...]

OPTIONS:
   --collation COLLATION             MySQL COLLATION (default: "utf8_general_ci")
   -d DISTANCE, --distance DISTANCE  Output only tables within a certain DISTANCE adjacent to each other with foreign keys from a specific table (default: 0)
   --database DATABASE               MySQL DATABASE name
   -f FILE, --file FILE              FILE for output (default: stdout)
   --format value                    Output format (plant_uml, mermaid. default:plant_uml)
   --host HOST                       MySQL HOST (default: "localhost")
   -i, --skip-index                  Whether don't print index to ERD. This option is used only --format=plant_uml
   --password PASSWORD               MySQL PASSWORD [$MYSQL_PASSWORD]
   --port PORT                       MySQL PORT (default: 3306)
   -s value, --skip-table value      Skip generating table by using regex patterns
   --show-comment                    Show column comment. This option is used only --format=mermaid
   -t TABLE, --table TABLE           Output only tables within a certain distance adjacent to each other with foreign keys from a specific TABLE
   --user USER                       MySQL USER (default: "root")

PostgreSQL

$ ./plant_erd postgresql --help
NAME:
   plant_erd postgresql - Generate ERD from PostgreSQL

USAGE:
   plant_erd postgresql [command options] [arguments...]

OPTIONS:
   -d DISTANCE, --distance DISTANCE  Output only tables within a certain DISTANCE adjacent to each other with foreign keys from a specific table (default: 0)
   --database DATABASE               PostgreSQL DATABASE name
   -f FILE, --file FILE              FILE for output (default: stdout)
   --format value                    Output format (plant_uml, mermaid. default:plant_uml)
   --host HOST                       PostgreSQL HOST (default: "localhost")
   -i, --skip-index                  Whether don't print index to ERD. This option is used only --format=plant_uml
   --password PASSWORD               PostgreSQL PASSWORD [$POSTGRES_PASSWORD]
   --port PORT                       PostgreSQL PORT (default: 5432)
   -s value, --skip-table value      Skip generating table by using regex patterns
   --show-comment                    Show column comment. This option is used only --format=mermaid
   --sslmode SSLMODE                 PostgreSQL SSLMODE. c.f. https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS (default: "disable")
   -t TABLE, --table TABLE           Output only tables within a certain distance adjacent to each other with foreign keys from a specific TABLE
   --user USER                       PostgreSQL USER

Oracle

$ ./plant_erd-oracle --help
NAME:
   plant_erd-oracle - ERD exporter with PlantUML and Mermaid format (for oracle)

USAGE:
   plant_erd-oracle [global options] command [command options] [arguments...]

VERSION:
   vX.X.X (build. xxxxxxx)

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   -f FILE, --file FILE              FILE for output (default: stdout)
   -t TABLE, --table TABLE           Output only tables within a certain distance adjacent to each other with foreign keys from a specific TABLE
   -d DISTANCE, --distance DISTANCE  Output only tables within a certain DISTANCE adjacent to each other with foreign keys from a specific table (default: 0)
   -i, --skip-index                  Whether don't print index to ERD. This option is used only --format=plant_uml
   -s value, --skip-table value      Skip generating table by using regex patterns
   --format value                    Output format (plant_uml, mermaid. default:plant_uml)
   --show-comment                    Show column comment. This option is used only --format=mermaid
   --user USER                       Oracle USER
   --password PASSWORD               Oracle PASSWORD [$ORACLE_PASSWORD]
   --host HOST                       Oracle HOST (default: "localhost")
   --port PORT                       Oracle PORT (default: 1521)
   --service SERVICE                 Oracle SERVICE name
   --help, -h                        show help
   --version, -v                     print the version

About --table and --distance

When --table and --distance are passed, output only tables within a certain distance adjacent to each other with foreign keys from a specific table.

Example 1: Output all tables

$ ./plant_erd sqlite3

example all

Example 2: Output only tables within a distance of 1 from the articles

$ ./plant_erd sqlite3 --table articles --distance 1

example distance 1 from articles

Testing

with all databases

Run test in container

docker-compose up --build --abort-on-container-exit

with only SQLite3

Run test on local

make test

License

The program is available as open source under the terms of the MIT License.

But plant_erd-oracle contains Oracle Instant Client. Oracle Instant Client is under OTN License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].