How It Works
- Paste your Mermaid ER diagram. Any
erDiagramworks: entities with attribute blocks, relationship lines in symbol or word form, aliases, and labels. - Click Convert. The conversion is exact and instant. Your diagram is parsed directly, no AI involved.
- Copy the DBML. Or click Open in VibeSchema to see it as a diagram and keep editing.
What the Converter Fills In
Mermaid describes relationships between entities but never declares the foreign key columns a real database needs. DBML references point at concrete columns, so the converter synthesizes what is missing:
- Foreign key columns. A one-to-many relationship puts a key column on the many side. If your entity already declares a matching column (like
customer_id, or a column markedFK), it is reused instead of duplicated. - Junction tables. Many-to-many relationships become a junction table with a composite primary key and a note saying it was auto-generated.
- Minimal tables. Entities declared with no attributes get an
idprimary key, since a DBML table needs at least one column.
Attribute keys carry over: PK becomes [pk], UK becomes
[unique], and trailing comment strings become column notes.
Want a Diagram Image?
After converting, click Open in VibeSchema and export from there, or paste the DBML into the DBML to PNG or DBML to SVG tool.
Want More Control?
The VibeSchema schema tool gives you the full editor: chat with AI to evolve your schema, edit the DBML directly, rearrange tables by hand, store your schemas as projects with snapshot history, and export the result as an image or DBML file.
Free, No Sign-Up
VibeSchema is free to use. No account required. Paste your Mermaid diagram above and copy the DBML.