enterd

package module
v0.0.0-...-e71670f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

enterd

enterd is an ent extension that create Mermaid-Js (Entity Relationship Diagrams) ERD diagrams of your ent's schema.

inspired by mermerd

inspired by entviz

install

go get github.com/bytectl/enterd

add this extension to ent (see example code) run

go generate ./ent

your html will be saved at ent/schema-erd.mmd

Use from command line

Install the cmd

go get  github.com/bytectl/enterd/cmd/enterd

Then run inside your project:

enterd ./etc/schema

example

image (3)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ERDType

func ERDType(c *schema.Column) (t string)

func GenerateMMD

func GenerateMMD(schemaPath string, cfg *gen.Config) ([]byte, error)

func Relation

func Relation(r *gen.Relation) string

func TableComment

func TableComment(c *gen.Type) string

func VisualizeSchema

func VisualizeSchema(next gen.Generator) gen.Generator

VisualizeSchema is an ent hook that generates a static html page that visualizes the schema graph.

Types

type Extension

type Extension struct {
	entc.DefaultExtension
}

func (Extension) Hooks

func (Extension) Hooks() []gen.Hook

func (Extension) Templates

func (Extension) Templates() []*gen.Template

Directories

Path Synopsis
cmd
examples
ent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL