MCPcopy Index your code
hub / github.com/achiku/planter

github.com/achiku/planter @0.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.3.0 ↗ · + Follow
28 symbols 77 edges 5 files 16 documented · 57%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

planter

Build Status GitHub license Go Report Card

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 supports ER diagram in the latest version with this awesome pull request. 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

Specify table names

planter postgres://planter@localhost/planter?sslmode=disable \ 
    -t order_detail \
    -t sku \
    -t product

Help

$ planter --help
usage: planter [<flags>] <conn>

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, --xtable=TABLE ... exclude target tables

Args:
  <conn>  PostgreSQL connection string in URL format

Test

install dependencies.

go get -u github.com/mattn/gom
gom install

setup database.

create database planter;
create user planter;

Extension points exported contracts — how you extend this code

Queryer (Interface)
Queryer database/sql compatible query interface
planter.go

Core symbols most depended-on inside this repo

LoadTableDef
called by 5
planter.go
Query
called by 3
planter.go
IsCompositePK
called by 3
planter.go
FindTableByName
called by 3
planter.go
FindColumnByName
called by 2
planter.go
LoadColumnDef
called by 2
planter.go
LoadForeignKeyDef
called by 2
planter.go
TableToUMLEntry
called by 2
planter.go

Shape

Function 19
Method 5
Struct 3
Interface 1

Languages

Go100%

Modules by API surface

planter.go20 symbols
planter_test.go7 symbols
main.go1 symbols

Datastores touched

planterDatabase · 1 repos

For agents

$ claude mcp add planter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact