Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/achiku/planter
Generate PlantUML ER diagram textual description from PostgreSQL tables
https://github.com/achiku/planter
er-diagram plantuml posgresql
Last synced: about 1 month ago
JSON representation
Generate PlantUML ER diagram textual description from PostgreSQL tables
- Host: GitHub
- URL: https://github.com/achiku/planter
- Owner: achiku
- License: mit
- Created: 2017-09-17T02:43:07.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-30T20:03:11.000Z (9 months ago)
- Last Synced: 2024-08-01T13:26:05.230Z (4 months ago)
- Topics: er-diagram, plantuml, posgresql
- Language: Go
- Homepage:
- Size: 211 KB
- Stars: 544
- Watchers: 11
- Forks: 53
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - achiku/planter - Generate PlantUML ER diagram textual description from PostgreSQL tables (Go)
README
# planter
[![test](https://github.com/achiku/planter/actions/workflows/test.yml/badge.svg)](https://github.com/achiku/planter/actions/workflows/test.yml)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/achiku/planter/master/LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/achiku/planter)](https://goreportcard.com/report/github.com/achiku/planter)Generate PlantUML ER diagram textual description from PostgreSQL tables
## Why created
A team with only software engineers doesn't need ER diagram that much as long as they have decent experience in Relational Database modeling. However, it becomes very helpful to have always-up-to-date ER diagram when marketing/promotion/operation teams consisting of those who are fluent in writing/reading SQL, join to the game.
[PlantUML](http://plantuml.com/) supports ER diagram in the latest version with [this awesome pull request](https://github.com/plantuml/plantuml/pull/31). The tool, planter, generates textual description of PlantUML ER diagram from pre-existing PostgreSQL tables, and makes it easy to share visual structure of relations with other teams.
## Installation
```
go get -u github.com/achiku/planter
```## Quick Start
```
$ planter postgres://planter@localhost/planter?sslmode=disable -o example.uml
$ java -jar plantuml.jar -verbose example.uml
```![er diagram](./example/example_gen.png)
## Specify table names
```
planter postgres://planter@localhost/planter?sslmode=disable \
-t order_detail \
-t sku \
-t product
```## Help
```
$ planter --help
usage: planter []Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
-s, --schema="public" PostgreSQL schema name
-o, --output=OUTPUT output file path
-t, --table=TABLE ... target tables
-x, --exclude=EXCLUDE ... target tables
-T, --title=TITLE Diagram titleArgs:
PostgreSQL connection string in URL format
```## Test
Run on docker
```
make
```or setup manually and run test
```
create database planter;
create user planter;
```run `go test ./... -v`