SQL & DBML Synchronization
Qubase automatically synchronizes your visual database model with SQL and DBML, allowing you to switch between visual design and code without rebuilding your schema.
This synchronization helps maintain a single source of truth for your database design.
Before you begin
Before using SQL or DBML synchronization, ensure that you have:
- Created a Database Schema
- Designed at least one table
- Saved your schema
[!NOTE] Synchronization is available only for supported database models.
What is SQL synchronization?
SQL synchronization converts your visual database design into executable SQL statements.
You can use the generated SQL to:
- Create databases
- Create tables
- Define constraints
- Build relationships
- Deploy your schema
What is DBML synchronization?
DBML (Database Markup Language) is a human-readable language for describing database structures.
Qubase keeps your ERD and DBML synchronized so that changes in one representation are reflected in the other.
Supported synchronization
Qubase supports:
- ERD → SQL
- ERD → DBML
- DBML → ERD
- SQL → ERD (when supported)
The available synchronization options depend on your project configuration and database type.
Generate SQL
To generate SQL:
- Open a Database Schema.
- Complete your database design.
- Select Generate SQL.
- Review the generated SQL.
- Export or copy the script.
Generated SQL follows the selected database system whenever possible.
Generate DBML
To generate DBML:
- Open your Database Schema.
- Select Generate DBML.
- Review the generated code.
- Copy or export the result.
DBML can be shared, versioned, or imported into compatible tools.
Synchronization workflow
ERD Canvas
│
├────────► SQL
│
└────────► DBMLChanges made to the visual model are reflected in generated outputs during synchronization.
Validation
Before synchronization, Qubase validates the database schema.
Validation checks may include:
- Missing Primary Keys
- Invalid Foreign Keys
- Duplicate table names
- Missing data types
- Invalid relationships
Any validation issues should be resolved before exporting SQL or DBML.
Best practices
- Complete your schema before generating SQL.
- Validate the model before exporting.
- Review generated SQL before deploying it.
- Keep SQL and DBML synchronized with the latest database design.