diff --git a/README.md b/README.md index 0396439..8a392b5 100644 --- a/README.md +++ b/README.md @@ -449,8 +449,8 @@ and a conformance kit that validates a bespoke mapping in CI. ### Import and export, from the Model tab The Model tab's toolbar has **Export** and **Import** menus. Export downloads the model -in any interchange format; import parses SQL DDL, a Mermaid diagram, or a JSON Schema and -stages it as a proposal you review before it lands. +in any interchange format; import parses SQL DDL, a Mermaid diagram, a JSON Schema, or an +**erwin XML export** and stages it as a proposal you review before it lands. ![The Export menu open in the Model-tab toolbar: a SQL dialect selector and download items for SQL DDL, Mermaid erDiagram, DBML, CSV, an ODCS data contract, and Neo4j Cypher](docs/assets/export-menu.png) @@ -459,6 +459,24 @@ stages it as a proposal you review before it lands. An imported model is visible on the canvas immediately as a staged preview — nothing touches disk or git until you submit the proposal. +### Import from erwin + +Nobody adopts a modeling tool greenfield, so `mdl import erwin` reads a real erwin Data +Modeler XML export and turns it into a committable Modelith model — entities, primary and +foreign keys, relationships (with their verb phrases), subtype/supertype categories, +subject areas, and domains, keeping the physical names alongside the logical ones: + +```bash +mdl import erwin your-model.xml -o model # writes a fresh model +mdl import erwin your-model.xml -o model --apply # or merge into an existing one +``` + +It parses the export by streaming, so 7-10MB files import without a memory spike, and it +degrades gracefully: anything Modelith doesn't model (views, ER-diagram layout, physical +transforms) is skipped with a note rather than a failure. In VS Code it's on the palette +(**Modelith: Import Erwin XML**), a button in the Reverse Review panel, and a right-click +on any `.xml` file. + ## Reverse engineering a real warehouse `mdl reverse` lifts a warehouse into a logical model from any of three sources — a diff --git a/canvas/src/Inspector.tsx b/canvas/src/Inspector.tsx index 9c2d600..35757d9 100644 --- a/canvas/src/Inspector.tsx +++ b/canvas/src/Inspector.tsx @@ -56,6 +56,18 @@ export function Inspector({ readOnly={readOnly} onCommit={(v) => exec("rename_entity", { id: entity.id, name: v })} /> + {(entity.physical_name || !readOnly) && ( +
+ physical + exec("rename_entity", { id: entity.id, physical_name: v })} + /> +
+ )}
@@ -260,10 +272,33 @@ export function Inspector({ const other = r.from.entity === entity.id ? r.to.entity : r.from.entity; return (
- +
+ + {(r.verb_phrase || r.inverse_verb_phrase || !readOnly) && ( +
+ exec("update_relationship", { id: r.id, verb_phrase: v })} + /> + / + + exec("update_relationship", { id: r.id, inverse_verb_phrase: v }) + } + /> +
+ )} +
{!readOnly && (