Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

DBML ER Diagrams

Wilmar Rojas AvendañoWilmar Rojas Avendaño341 downloads

Render dbml code blocks as interactive entity-relationship diagrams with dbdiagram.io-style orthogonal routing.

Add to Obsidian
DBML ER Diagrams screenshot
DBML ER Diagrams screenshot
DBML ER Diagrams screenshot
  • Overview
  • Scorecard
  • Updates18

Obsidian plugin that renders ```dbml code blocks as interactive entity-relationship diagrams, with orthogonal, dbdiagram.io-style routing (right-angle lines), crow's-foot notation (crow's foot / bar) and direct editing on the canvas.

  • Plugin ID: dbml-erd
  • Name: DBML ER Diagrams
  • Author: Wilmar Rojas Avendaño · License: MIT
  • Minimum Obsidian version: 1.6.0 · Works on desktop and mobile.

What it does

You write a ```dbml block with your tables and relationships and the plugin draws it as an SVG ERD, with automatic layout, cardinality markers and interactive editing. Every change you make from the diagram (rename, move, color, cardinality, delete…) is written back into the note's own dbml block — the block is the single source of truth.

Render and layout

  • Renders dbml / DBML blocks to an SVG ERD.
  • Automatic layout with elkjs (elk.layered) that minimizes crossings.
  • Orthogonal (90°) routing in dbdiagram.io style, with rounded corners; lines re-route live as you move tables.
  • Layout cache by structure: saving the layout does not recompute the layout nor cause flicker.
  • Theme integrated with Obsidian variables (automatic light/dark).

Notation

  • One symbol per endpoint for cardinality: crow's foot on the "many" side; on the "one" side, a bar (│) if the FK is not null, or a circle (○) if it is nullable.
  • PK (🔑) and FK (🔗) icons, NN badge for not null columns.
  • Per-table header color (text adjusts to white or dark depending on the background).

Canvas navigation

  • Pan (drag the empty space), zoom (mouse wheel), + / − / ⊡ (fit) buttons.
  • Resizable canvas (width and height).
  • Table positions, zoom/pan and canvas size are persisted inside the block and restored when you reopen the note.

Interactive editing (from the diagram)

Everything is saved back to the dbml block:

  • Table header (click the node header) → menu:
    • Rename table… (also updates references).
    • Pick color… / Remove color.
    • Delete table… (with confirmation dialog; removes the table and the relationships that reference it).
  • Column row (click a column) → menu:
    • Rename column… (updates table.col references).
    • Change type…
  • Connection / relationship (click the line):
    • First click: selects it and shows the route vertices.
    • Second click: menu with the relationship type (cardinality) — One to many, Many to one, One to one, Many to many (the current one is checked) —, "Reset route" (if hand-edited) and "Deselect".
  • Route vertices (with the connection selected):
    • Add: tap/drag the + handle in the middle of a segment.
    • Move: drag a vertex (the line re-orthogonalizes itself to 90°).
    • Delete: right-click on a vertex → "Delete vertex"; if it was the last one, the route returns to automatic mode.

Language

The interface (menus, dialogs and notices) is available in English (default) and Spanish. Switch it under Settings → Community plugins → DBML ER Diagrams → Language.


Usage

Insert a code block with the dbml language:

```dbml
// height: 600

Table contract {
  contract_id   int          [pk]
  contract_name varchar(120) [not null]
  client_id     int          [not null]
  status        varchar(20)
}

Table client {
  client_id int          [pk]
  name      varchar(100) [not null]
}

Ref: contract.client_id > client.client_id
```

Supported syntax

  • Table name { ... } (and the short form name { ... }).
  • Columns: name type [pk, not null, note: '...', ref: > other.col].
  • Relationships: a Ref: a.col > b.col line, inline ref: > b.col, or the direct form a.col <> b.col.
  • Cardinality operators: > (many→one), < (one→many), <> (many↔many), - (one↔one).
  • Per-table header color: Table name [headercolor: #2E7D32] { ... }.
  • Table and column notes (Note: '...', note: '...').
  • Optional // height: N directive (canvas height in px).
  • // comments.

A deliberate subset of DBML, enough for controlled schemas. It does not yet include enums, table groups or composite keys.

Layout annotations (managed by the plugin)

The plugin stores the visual state as comments inside the block; you don't need to edit them by hand:

  • // @pos <table> <x> <y> — position of a moved table.
  • // @view <x> <y> <zoom> — pan and zoom.
  • // @size <w> <h> — canvas size.
  • // @edge <from> <fromCol> <to> <toCol> <x1> <y1> … — vertices of a hand-edited route.

Generate the DBML automatically (sql-to-dbml skill)

So you don't have to write the DBML by hand there is a Claude Code skill, sql-to-dbml, that converts SQL CREATE TABLE scripts (generic ANSI) — or tables you define during the conversation — into DBML compatible with this plugin (it degrades to what the plugin draws, never emitting syntax it can't understand).

  • Repository: https://github.com/wrojasa/skill-sql-to-dbml
  • Typical triggers: "convert this CREATE TABLE to dbml", "generate the dbml for these tables", "build the ERD in dbml", "add this table to the dbml", "update the dbml with…".

Paste the resulting block into a note inside ```dbml and the plugin renders it.


Installation

Manual

  1. Download main.js, manifest.json and styles.css from the latest release.
  2. Copy the three files to <vault>/.obsidian/plugins/dbml-erd/.
  3. Enable the plugin under Settings → Community plugins.

Development

npm install
npm run dev     # build with inline sourcemaps
npm run build   # minified production build

Code structure:

  • src/main.ts — plugin, block rendering and the Diagram class (SVG, interaction, persistence).
  • src/parser.ts — DBML parser (subset) and block mutators (rename, types, cardinality, delete).
  • src/layout.ts — layout with elkjs and geometry constants.
  • src/i18n.ts — interface strings (English/Spanish) and the t() lookup.
  • styles.css — styles integrated with Obsidian's theme variables.

Release

Releases are produced with GitHub Actions (.github/workflows/release.yml). To publish a new version: bump version in manifest.json and package.json, add the entry to versions.json and CHANGELOG.md, create a tag with that exact number (no v prefix) and push it:

# use the exact number from the manifest, without the v prefix
git tag 0.1.19
git push origin 0.1.19

The workflow compiles and attaches main.js, manifest.json and styles.css to the release.

License

MIT © 2026 Wilmar Rojas Avendaño

HealthExcellent
ReviewSatisfactory
About
Render DBML code blocks as clean, interactive ER diagrams - styled after dbdiagram.io, right in Obsidian. Write a fenced dbml block describing your tables and relationships, and the plugin draws an ERD with orthogonal (90°) edge routing, crow's-foot / bar cardinality markers, and primary-key ( ) / foreign-key ( ) indicators. Features: - Live rendering of dbml blocks into ER diagrams. - Orthogonal edge routing (90° elbows) with rounded corners. - Drag tables to arrange the layout; positions persist with the note. - Editable connections: add, move, delete route vertices, or reset to automatic. - Change cardinality from the diagram (one-to-many, one-to-one, many-to-many). - Edit from the canvas: rename tables/columns, change types, set header colors, delete tables — all written back to the dbml source. - Persistent layout: positions, zoom/pan, and custom routes saved in the block. - Works on desktop and mobile.
VisualizationCanvasMarkdown
Details
Current version
0.1.21
Last updated
4 weeks ago
Created
2 months ago
Updates
18 releases
Downloads
341
Compatible with
Obsidian 1.6.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
Wilmar Rojas AvendañoWilmar Rojas Avendañowrojasa
www.sigesoft.com.co
GitHubwrojasa
wrojas-av
  1. Community
  2. Plugins
  3. Visualization
  4. DBML ER Diagrams

Related plugins

Advanced Canvas

Supercharge your canvas experience. Create presentations, flowcharts and more.

Markwhen

Create timelines, gantt charts, calendars, and more using markwhen.

Importer

Convert your data to Markdown files you can use in Obsidian. Works with Apple Notes, OneNote, Evernote, Notion, Google Keep, and many other formats.

Excalidraw

Visual PKM powerhouse. Create and edit Excalidraw drawings.

Breadcrumbs

Visualise the hierarchy of your vault using a breadcrumb trail or matrix view.

Maps

Adds a map layout to bases so you can display notes as an interactive map view.

Mermaid Tools

Improved Mermaid.js experience: visual toolbar with common elements and more.

Outliner

Work with your lists like in Workflowy or Roam Research.

Linter

Format and style your notes. Linter can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular Markdown contents like list, italics, and bold styles; and more with the use of custom rule options.

ExcaliBrain

An interactive, structured mind-map of your Obsidian vault.