Skip to content
Back to search

erd-editor

Design database schemas as ERDs in your browser, VS Code, JetBrains IDEs or Obsidian. Import SQL, DBML and GraphQL, export DDL and code, and let coding agents edit live over MCP.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/dineug--erd-editor/badge.svg)](/listings/dineug--erd-editor)

HTML

<a href="/listings/dineug--erd-editor"><img src="/api/listings/dineug--erd-editor/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 233 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # ERD Editor
  2. > Design database schemas visually: in your browser, in your IDE, or by asking your coding agent
  3. English | [한국어](./README.ko.md) | [中文](./README.zh-CN.md) | [日本語](./README.ja.md)
  4. **[Open erd-editor.io](https://erd-editor.io)** in your browser, nothing to install, or get it for
  5. [VS Code](https://marketplace.visualstudio.com/items?itemName=dineug.vuerd-vscode),
  6. [JetBrains IDEs](https://plugins.jetbrains.com/plugin/23594-erd-editor),
  7. [Obsidian](https://community.obsidian.md/plugins/erd-editor) and
  8. [Google Drive](https://workspace.google.com/marketplace/app/erd_editor/428467403360).
  9. <picture>
  10. <source media="(prefers-color-scheme: dark)" srcset="https://github.com/dineug/erd-editor/blob/main/img/erd-editor-vscode-dark.png?raw=true">
  11. <img alt="ERD Editor" src="https://github.com/dineug/erd-editor/blob/main/img/erd-editor-vscode-light.png?raw=true">
  12. </picture>
  13. One editor and one `.erd.json` file wherever you work: on the web, in Google Drive, VS Code,
  14. JetBrains IDEs and Obsidian, inside your own app, and in your coding agent's hands.
  15. ## Features
  16. - **Design** — tables, columns, memos and table groups, four relationship cardinalities, ON DELETE
  17. and ON UPDATE, alternate keys, Auto Layout
  18. - **Naming standards** — logical and physical names, physical names and data types derived from
  19. word, term and domain dictionaries, which have their own tab with CSV import and export and checks
  20. - **Import** — SQL DDL, GraphQL SDL, DBML and AML, replacing the diagram or adding to it
  21. - **Export** — DDL for eight databases, code in 22 languages and ORMs, PNG and SVG
  22. - **Navigate** — command palette (`Ctrl`/`Cmd`+`K`), an Explorer tree with find and replace, Graph
  23. and Flow views
  24. - **History** — undo and redo, time travel through the session, a diff viewer against another file
  25. - **25 languages** and a System, Light or Dark theme with your own gray and accent colors
  26. - **Collaboration** — live sessions on erd-editor.io, and [coding agents](#coding-agents) that edit
  27. beside you
  28. **Databases:** Databricks, MariaDB, MSSQL, MySQL, Oracle, PostgreSQL, Snowflake, SQLite
  29. **Code:** TypeScript, GraphQL, C#, Java, JPA, Kotlin, Scala, Go, SQLAlchemy, TypeORM, Sequelize,
  30. Drizzle, DBML, AML, Mermaid, PHP, Doctrine, Rust, SeaORM, Swift, Zod, JSON Schema
  31. Every feature step by step: the [Editing Guide](https://docs.erd-editor.io/docs/category/guides).
  32. ## Coding agents
  33. Ask Claude Code, Codex or any MCP client to change the schema, and watch it happen on the canvas.
  34. ![coding agents](https://github.com/dineug/erd-editor/blob/main/img/coding-agents.webp?raw=true)
  35. [`@dineug/erd-editor-mcp`](./packages/mcp-server) gives the agent one tool per editing operation.
  36. When VS Code, Obsidian or a JetBrains IDE holds the diagram, the agent joins it as one more
  37. collaborator, and its undo reverts only its own edits; with no editor, it edits the file on disk.
  38. An editor with its connection off, or an untrusted workspace or project, lets the agent read but
  39. refuses its edits. It needs Node.js 22.12 or later. Add it with one command, in your project folder:
  40. ```sh
  41. # Claude Code
  42. claude mcp add --transport stdio erd-editor -- npx -y @dineug/erd-editor-mcp
  43. # Codex
  44. codex mcp add erd-editor -- npx -y @dineug/erd-editor-mcp
  45. ```
  46. Other clients and the tool list: [its README](./packages/mcp-server).
  47. ## Where to use it
  48. | | Install | |
  49. | --- | --- | --- |
  50. | **Web app** | [erd-editor.io](https://erd-editor.io) | Installable PWA that works offline, with real-time collaboration |
  51. | **Google Drive** | [Google Workspace Marketplace](https://workspace.google.com/marketplace/app/erd_editor/428467403360) | Drive's Open with and New menus, saving back to the same file |
  52. | **VS Code** | [Marketplace](https://marketplace.visualstudio.com/items?itemName=dineug.vuerd-vscode) | Opens `.erd.json` files |
  53. | **IntelliJ** | [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/23594-erd-editor) | Opens `.erd.json` files in IntelliJ-based IDEs |
  54. | **Obsidian** | [Community plugins](https://community.obsidian.md/plugins/erd-editor) | Opens `.erd` and `.erd.json` files in a vault, desktop only |
  55. | **Your app** | `npm install @dineug/erd-editor` | The `<erd-editor>` custom element and the read-only `<erd-viewer>`, no framework needed |
  56. | **Coding agents** | [`@dineug/erd-editor-mcp`](./packages/mcp-server) | MCP server for Claude Code, Codex and other clients |
  57. In an IDE, create an empty `.erd.json` file and open it. In Obsidian, run
  58. **ERD Editor: Create new diagram**; in Google Drive, choose **New → More → ERD Editor**.
  59. ## Real-time collaboration
  60. Every ERD Editor shares its edits as a stream of actions, which keeps several views of one diagram
  61. in sync, such as browser tabs or split editors, and lets a coding agent join as one more
  62. collaborator.
  63. On [erd-editor.io](https://erd-editor.io), choose **Start session** from the collaboration button in
  64. the sidebar and share the link: everyone who opens it edits with you. The link is the only key,
  65. so share it only with people you would let edit. The session lives in the host's browser and ends
  66. when the host closes their last tab, so a guest who wants the diagram exports it first.
  67. Peers connect over WebRTC, with the diagram and every edit encrypted by AES-GCM. The signaling relay
  68. never sees plaintext, and the room key lives in the URL fragment, which browsers leave out of every
  69. request.
  70. <details>
  71. <summary>Architecture</summary>
  72. ```mermaid
  73. flowchart TB
  74. subgraph clientA["Client A"]
  75. bcA["Broadcast Channel"]
  76. tabA1["Tab (leader)"]
  77. tabA2["Tab"]
  78. swA["Shared Worker"]
  79. idbA[("IndexedDB")]
  80. bcA <--> tabA1
  81. bcA <--> tabA2
  82. tabA1 <--> swA
  83. tabA2 <--> swA
  84. swA <--> idbA
  85. end
  86. subgraph clientB["Client B (guest)"]
  87. tabB1["Tab"]
  88. end
  89. relay["Signaling Relay (nostr / mqtt)"]
  90. tabA1 <-->|"WebRTC (AES-GCM)"| tabB1
  91. tabA1 -. "signaling" .-> relay
  92. tabB1 -. "signaling" .-> relay
  93. ```
  94. </details>
  95. ## Embedding
  96. ```sh
  97. npm install @dineug/erd-editor
  98. ```
  99. ```js
  100. import '@dineug/erd-editor/erd-editor.js';
  101. const editor = document.createElement('erd-editor');
  102. // the editor fills its container, and a custom element is inline by default
  103. Object.assign(editor.style, { display: 'block', width: '100%', height: '100vh' });
  104. document.body.appendChild(editor);
  105. ```
  106. To show a diagram without editing it, import `@dineug/erd-editor/erd-viewer.js` and place
  107. `<erd-viewer src="diagram.erd.json" style="display: block; height: 480px"></erd-viewer>`, which
  108. pans, zooms and searches it within the box its style gives it. Importing the package root defines
  109. neither element.
  110. A page that cannot load scripts, such as a wiki or a site builder, can frame the hosted viewer
  111. instead:
  112. ```html
  113. <iframe src="https://erd-editor.io/embed?src=https%3A%2F%2Fgithub.com%2Fdineug%2Ferd-editor%2Fblob%2Fmain%2Fdata%2Fembed-small.erd.json" width="100%" height="480" style="border: 0" loading="lazy" title="ERD Editor"></iframe>
  114. ```
  115. That line shows this repository's [`data/embed-small.erd.json`](./data/embed-small.erd.json). The
  116. builder at [erd-editor.io/embed](https://erd-editor.io/embed) writes it from a file's URL and the
  117. viewer's options. A file or gist on GitHub can be given by the address its page shows, as here; the
  118. hosted viewer fetches it from GitHub's raw host, which caches each file for five minutes and works
  119. for public repositories and public gists only, and of a gist it shows the first file. Any other
  120. server holding the file has to allow erd-editor.io's cross-origin requests (CORS).
  121. Both elements work from any framework or from none. Attributes and the element API:
  122. [`packages/erd-editor`](./packages/erd-editor).
  123. ## Documentation
  124. - [Editing Guide](https://docs.erd-editor.io/docs/category/guides) — every editor feature
  125. - [Element API](https://docs.erd-editor.io/docs/api/erd-editor-element) — `<erd-editor>` for your
  126. own app; `<erd-viewer>` is in [`packages/erd-editor`](./packages/erd-editor)
  127. - [MCP](https://docs.erd-editor.io/docs/mcp/introduction) — the MCP server and its tools
  128. - [Documentation](https://docs.erd-editor.io)
  129. ## Packages
  130. A pnpm workspace. [`@dineug/erd-editor`](./packages/erd-editor),
  131. [`@dineug/erd-editor-mcp`](./packages/mcp-server) and
  132. [`@dineug/erd-editor-yjs`](./packages/erd-editor-yjs) are published to npm, the three plugins ship
  133. through their stores, `app` is erd-editor.io, and the rest are private libraries those builds take
  134. in.
  135. <details>
  136. <summary>All 21 packages</summary>
  137. | Folder | npm name | Description |
  138. | --- | --- | --- |
  139. | [`erd-editor`](./packages/erd-editor) | `@dineug/erd-editor` | The editor core: the `<erd-editor>` custom element, the read-only `<erd-viewer>` and the headless `engine.js` and `peer.js` entries |
  140. | [`erd-editor-yjs`](./packages/erd-editor-yjs) | `@dineug/erd-editor-yjs` | The published Yjs binding, which keeps an `<erd-editor>` or a headless peer store in step through a `Y.Doc` |
  141. | [`erd-editor-schema`](./packages/erd-editor-schema) | `@dineug/erd-editor-schema` | The v2/v3 document schema, parsing, serializers, queries and LWW operators |
  142. | [`schema-sql-parser`](./packages/schema-sql-parser) | `@dineug/schema-sql-parser` | Permissive DDL parser used for SQL import |
  143. | [`uuid`](./packages/uuid) | `@dineug/uuid` | UUIDv7 and the Uuid25 encoding, the ids the editor mints |
  144. | [`r-html`](./packages/r-html) | `@dineug/r-html` | The tagged-template rendering framework and store the editor is built on |
  145. | [`vite-plugin-r-html`](./packages/vite-plugin-r-html) | `@dineug/vite-plugin-r-html` | JSX → tagged templates, plus HMR boundaries |
  146. | [`r-html-konva`](./packages/r-html-konva) | `@dineug/r-html-konva` | The Konva host for r-html templates, which the editor's canvas renders through |
  147. | [`grid`](./packages/grid) | `@dineug/grid` | A spreadsheet grid on a Konva canvas, built on `r-html-konva`, that draws only the cells in view |
  148. | [`app`](./packages/app) | `@dineug/erd-editor-app` | The React PWA at erd-editor.io, with the Google Drive editor at `/gdrive`, whose OAuth relay is the Pages Function in `functions/` |
  149. | [`vscode-extension`](./packages/vscode-extension) | `vuerd-vscode` | The published VS Code extension, with its side of the coding-agent hub |
  150. | [`vscode-webview`](./packages/vscode-webview) | `@dineug/erd-editor-vscode-webview` | The bundle inside the VS Code webview |
  151. | [`webview-client`](./packages/webview-client) | `@dineug/erd-editor-webview-client` | The editor mounted into an IDE webview, host protocol wired, shared by both IDE bundles |
  152. | [`webview-bridge`](./packages/webview-bridge) | `@dineug/erd-editor-webview-bridge` | Typed host ↔ webview command protocol |
  153. | [`replication-store-worker`](./packages/replication-store-worker) | `@dineug/erd-editor-replication-store-worker` | Headless document replica in a Worker, serializing what the IDE webviews and the Obsidian plugin save |
  154. | [`intellij-webview`](./packages/intellij-webview) | `@dineug/erd-editor-intellij-webview` | The bundle inside the IntelliJ plugin's editor panel |
  155. | [`intellij-plugin`](./packages/intellij-plugin) | `@dineug/erd-editor-intellij-plugin` | The published IntelliJ plugin, in Kotlin and Gradle, with its own Kotlin hub for coding agents |
  156. | [`obsidian-plugin`](./packages/obsidian-plugin) | `@dineug/erd-editor-obsidian-plugin` | The Obsidian plugin, released from [erd-editor-obsidian-plugin](https://github.com/dineug/erd-editor-obsidian-plugin) |
  157. | [`agent-hub`](./packages/agent-hub) | `@dineug/erd-editor-agent-hub` | The protocol between an editor window and a coding agent's MCP server: messages, lock files, framing |
  158. | [`agent-hub-host`](./packages/agent-hub-host) | `@dineug/erd-editor-agent-hub-host` | The editor window's side of that protocol, shared by the VS Code extension and the Obsidian plugin; the IntelliJ plugin ports it to Kotlin |
  159. | [`mcp-server`](./packages/mcp-server) | `@dineug/erd-editor-mcp` | The published MCP server, live in VS Code, Obsidian or a JetBrains IDE, or headless on the file |
  160. </details>
  161. ## Development
  162. You need Node 22.22.1+, 24.11+ or 26+ (`.nvmrc` pins `22.23.2`), pnpm `10.34.3` and Git 2.32+; the
  163. IntelliJ plugin also needs JDK 17+.
  164. ```sh
  165. pnpm install
  166. pnpm --filter @dineug/erd-editor exec playwright install --with-deps chromium # for pnpm test
  167. pnpm --filter @dineug/erd-editor-app dev # the web app
  168. pnpm check # format and lint
  169. pnpm test # every package's type check and specs
  170. pnpm build
  171. ```
  172. The IntelliJ plugin builds with Gradle from [`packages/intellij-plugin`](./packages/intellij-plugin),
  173. and the e2e suites run apart from `pnpm test`. [AGENTS.md](./AGENTS.md) has the rest: which checks a
  174. change runs, coverage, the e2e suites and the commit rules.
  175. ## Contributing
  176. [Issues](https://github.com/dineug/erd-editor/issues) and pull requests are welcome. Commit
  177. messages follow [Conventional Commits](https://www.conventionalcommits.org/).
  178. ## License
  179. [MIT](./LICENSE) © SeungHwan-Lee

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.