GithubHelp home page GithubHelp logo

kaishuu0123 / erd-go Goto Github PK

View Code? Open in Web Editor NEW
124.0 3.0 36.0 608 KB

Translates a plain text description of a relational database schema to a graphical entity-relationship diagram.(convert to dot file)

License: MIT License

Makefile 5.42% Go 92.09% Dockerfile 2.49%
golang go dot translates erd peg diagramming diagram

erd-go's Introduction

erd-go

GitHub release Build Status Coverage Status Docker Pulls

Translates a plain text description of a relational database schema to a graphical entity-relationship diagram.(convert to dot file)

ER diagram for nfldb

Install

get binary from releases page.

or

go get github.com/kaishuu0123/erd-go

or (for Mac)

brew tap kaishuu0123/erd-go
brew install erd-go

Usage

Usage:
  erd-go [OPTIONS] PATTERN [PATH]

Application Options:
  -i, --input=  input will be read from the given file.
  -o, --output= output will be written to the given file.

Help Options:
  -h, --help    Show this help message

support input from STDIN.

cat examples/nfldb.er | erd-go

ex.) convert to png from dot (use dot command)

cat examples/nfldb.er | erd-go | dot -Tpng -o nfldb.png

Usage (Used by Docker container)

cat examples/nfldb.er | docker run --rm -i kaishuu0123/erd-go | docker run --rm -i risaacson/graphviz dot -T png > nfldb.png

Example

see examples directory

Build Instruction

  1. install glide

    go get github.com/Masterminds/glide
  2. install go-bindata

    go get github.com/jteeuwen/go-bindata
  3. install peg

    go get github.com/pointlander/peg
  4. make

    make

LICENSE

MIT

Credits

This work is based off of several existing projects:

erd-go's People

Contributors

apterf avatar glaslos avatar kaishuu0123 avatar ray-g avatar sickhye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

erd-go's Issues

explain, how to install on windows and what the binary does

I don't know Go and I never used it. I just want to use this VSC extension:
https://marketplace.visualstudio.com/items?itemName=kaishuu0123.vscode-erd-preview&ssr=false#overview

I tried to follow this instruction:

go get github.com/kaishuu0123/erd-go

I installed Go to be able to do this. And Go will do something, and finally there is something in this folder:

C:\Users\ggoer\go\pkg\mod\cache\download\github.com\kaishuu0123\erd-go@v

But I don't know Go, and I don't know if this is OK or not. There is no exe and there is no instruction how to build an exe binary.
Or maybe I don't need a binary? But on the instruction for the VSC extension it looks like I need some binary. Could you add some instructions how to build the binary after
go get github.com/kaishuu0123/erd-go

I tried to use binary from here: https://github.com/kaishuu0123/erd-go/releases
I don't know what this is: is it an installer? Or something different?

Maybe this is not an installer? When I execute it, then first I get some warning, I say: execute anyway, but there is only a black window for a short time. When I execute the binary again, then there is a black window for a short time again, but it is too short to read any message which could be there.

Could you add some information what kind of binary this is which can be executed but which will finish so fast?

I also don't understand the usage:

Usage:
  erd-go [OPTIONS] PATTERN [PATH]

I try to understand this instruction: there should be an application erd-go. Where to get it? How to build it? Or is the usage

Usage:
  windows_amd64_erd-go.exe [OPTIONS] PATTERN [PATH]

Colors Not Parsing

I have this portion of code inside my er file. This worked up until today when I reinstalled erd-go after reimaging my computer. I am getting the following error

ERD file parse error
title {label: "Operations Model", size: 20}

colors {
~~~~~~~
error

If I comment out the colors block it works without issue.

title {label: "Operations Model", size: 20}

colors {
	proj: "#f2f7fe",
	div: "#fee0cd",
	ops: "#e1f0ab",
	bd: "#f8ddee",
}

[DimDates_Project] {bgcolor:"proj", label: " Dimensions"}
	DateID
	Date
	DMRPeriod
	WeekEnd
	MonthEnd
	YearEnd

Cannot use period (.) in table name

I'd like to be able to denote the table schema in the name, so things like appname.Users, but the period is ignored (it doesn't render at least):

[appname.Users]
*name

Left-align attributes?

When I have a long table name, the attributes are offset quite far from the left margin

Unable to run on Windows 10

Hi and thank you for the cool tool!

I have erd-go working on my Ubuntu machine but can't seem to get it to run on Windows 10.

Can you spot what I'm missing?

Steps:

  1. Download dot binary from your repo
  2. Download graphviz binary from your repo
  3. Place them in C:/Users/myUser/tools/ directory
  4. Update settings.json in VS Code like:
"erd-preview.erdPath": "C:\\Users\\user7\\tools\\windows_amd64_erd-go.exe",
"erd-preview.dotPath": "C:\\Users\\user7\\tools\\graphviz-dot-win-x64.exe"
  1. Copy the sample .er file from your repo and paste it into a new file
colors {
    person: "#fcecec",
    loc: "#ececfc",
}

[User.Person] {bgcolor: "person" label: "comment"}
*name
height
weight
+birth_location_id

[Location] {bgcolor: "loc"}
*id
city
state
country

User.Person 1--* Location
  1. F1 then ERD: Preview current window
  2. No preview shown
    image

Thank you

Support calling Graphviz to process .dot output into image

First, just want to say this is a fantastic project you've brought forth. My question pertains to output, is there a way you could support (provided properly configured) having erd-go natively pass the .dot output to Graphviz and have it product the resultant image as part of calling erd-go?

This would be similar I believe to what the legacy erd project already does. It also reduces the hoops someone has to jump though to produce a resultant image. Right now we're looking to bake our images into a markdown output file. We can use Markdown Preview Enhanced to call erd-go, but we can't easily have it call Graphviz to produce a PNG in the same pipeline.

Homebrew formula on OS X?

This is super neat - any chance we could get a homebrew (https://brew.sh/) formula for MacOS X rather than a binary download? It would integrate well with the way most people get dot (from the graphviz formula) and would gracefully isolate from the rest of the system.

Stand-alone table layout taking too much vertical space

Hello,

Great piece of software! Thank you.

One improvement would be great:
If one has a mixed layout of stand-alone tables( tables with no relationships to other tables) and related tables (tables with relationship lines drawn), the stand-alone tables are drawn vertically (one after another in the same column), instead of taking horizontal space.

This creates a layout issue:
Screenshot

Is there any way to fix this issue?
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.