Documentation
¶
Overview ¶
Package erd provides schema introspection and ERD rendering for Postgres and MySQL databases. It uses information_schema to remain engine-agnostic and avoids any engine-specific system catalogue queries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderDBML ¶
RenderDBML writes a DBML representation to w. DBML (Database Markup Language) is the format used by dbdiagram.io.
Types ¶
type ForeignKey ¶
ForeignKey describes a referential constraint between two tables.
type Schema ¶
type Schema struct {
Tables []Table
ForeignKeys []ForeignKey
}
Schema is the result of introspecting a database.
func Introspect ¶
Introspect queries information_schema for tables, columns, primary keys, and foreign keys. engineName must be "postgres" or "mysql". database is only used for MySQL (Postgres always targets the "public" schema).
Click to show internal directories.
Click to hide internal directories.