Export DBML / SQL | ERD Generator Docs

Once your database diagram is ready, exporting it is the final step. The ERD Generator lets you export your schema into DBML, SQL, or JSON, so it fits seamlessly into your development workflow.

Whether you're sharing with teammates, committing to version control, or initializing a real database β€” exporting is fast, flexible, and precise.


πŸš€ Why Export Your Schema?

Exporting allows you to:

  • Turn visual diagrams into executable database schemas
  • Share designs with developers and stakeholders
  • Migrate from design to implementation smoothly
  • Keep schema definitions in version control

You design visually β€” the tool handles the format.


πŸ“„ Supported Export Formats

You can export your schema into the following formats:

  • DBML – Human-readable schema language, ideal for documentation and tooling
  • MySQL – SQL compatible with MySQL databases
  • PostgreSQL – SQL optimized for PostgreSQL
  • Microsoft SQL Server – SQL Server compatible syntax
  • JSON – Structured format for integrations and tooling

Choose the format that best matches your target environment.


🧭 How to Export a Diagram

  1. Open the diagram you want to export
  2. Click Export from the toolbar or menu
  3. Choose the desired export format (DBML, SQL dialect, or JSON)
  4. Adjust export options (if needed)
  5. Download or copy the generated output

That’s it β€” no manual conversion required.


βš™οΈ Selecting SQL Dialects

SQL syntax differs slightly between databases. You can select the correct dialect before exporting:

  • MySQL
  • PostgreSQL
  • Microsoft SQL Server

This ensures:

  • Correct data types
  • Proper constraint syntax
  • Compatible indexing and key definitions

Your exported SQL will run cleanly on the selected database engine.


🧩 Include or Exclude Metadata

You can control what gets included in the export:

Optional Metadata Controls

  • Include or exclude comments
  • Include or exclude indexes
  • Include or exclude constraints
  • Include or exclude relationships

This is useful when:

  • Sharing a simplified schema
  • Preparing production-ready SQL
  • Exporting only structural definitions

You stay in control of the output.


πŸ”„ DBML Export Use Cases

DBML exports are ideal when:

  • You want a readable schema definition
  • You plan to re-import or iterate later
  • You’re collaborating with other design tools
  • You want lightweight versioning of schema changes

DBML keeps your design clean and portable.


πŸ—„οΈ SQL Export Use Cases

SQL exports are perfect when:

  • Initializing a new database
  • Running migrations manually
  • Sharing schema with backend teams
  • Testing schema changes locally

The generated SQL reflects your diagram accurately β€” tables, keys, and relations included.


🧠 Best Practices

  • Choose the correct SQL dialect before exporting
  • Exclude metadata when you need clean, minimal schemas
  • Export DBML for iteration, SQL for execution
  • Keep exported files in version control for traceability

✨ Summary

  • Export diagrams as DBML, SQL, or JSON
  • Select database-specific SQL dialects
  • Control metadata inclusion
  • Move seamlessly from design to implementation

With export options built in, your ERD is always ready for the next step.