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
- Open the diagram you want to export
- Click Export from the toolbar or menu
- Choose the desired export format (DBML, SQL dialect, or JSON)
- Adjust export options (if needed)
- 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.