Forward Engineering
Forward Engineering transforms your visual database model into executable SQL scripts for a supported database management system.
Instead of manually writing SQL, Qubase converts your ERD, tables, columns, relationships, constraints, and indexes into SQL statements that can be reviewed, exported, or executed.
This allows database designs to move from planning to implementation efficiently.
Before you begin
Before generating SQL, ensure that you have:
- Completed your database model
- Defined all Primary Keys
- Configured Foreign Keys
- Selected a target DBMS
- Resolved all validation issues
[!NOTE] Forward Engineering generates SQL from the current database model. It does not automatically execute SQL against your database unless deployment is explicitly initiated.
What is generated?
Qubase can generate SQL for:
- Database creation
- Tables
- Columns
- Primary Keys
- Foreign Keys
- Constraints
- Indexes
- Default values
- Relationships
Generated SQL follows the syntax of the selected database system whenever possible.
Forward Engineering workflow
Visual Database Model
│
▼
Validate Database Model
│
▼
Choose Target DBMS
│
▼
Generate SQL
│
▼
Review SQL
│
▼
Export or DeployGenerate SQL
To generate SQL:
- Open your Database Schema.
- Complete the database design.
- Open Forward Engineering.
- Select the target database system.
- Validate the schema.
- Generate SQL.
- Review the generated script.
- Export or deploy the SQL.
Supported output
Depending on your project configuration, Qubase may generate:
| Output | Description |
|---|---|
| CREATE DATABASE | Create a new database |
| CREATE TABLE | Create database tables |
| ALTER TABLE | Modify existing tables |
| CREATE INDEX | Create indexes |
| FOREIGN KEY | Generate relationships |
| CHECK | Validation constraints |
| DEFAULT | Default values |
Database compatibility
Generated SQL adapts to the selected DBMS.
Supported systems may include:
- PostgreSQL
- MySQL
- Microsoft SQL Server
Database-specific syntax is applied where applicable.
SQL preview
Before exporting, Qubase displays a SQL preview.
The preview allows you to:
- Review generated SQL
- Detect potential issues
- Copy SQL
- Download SQL scripts
Reviewing SQL before deployment is recommended.
Validation
Before SQL generation, Qubase performs validation checks.
Examples include:
- Missing Primary Keys
- Invalid Foreign Keys
- Duplicate table names
- Missing data types
- Unsupported constraints
- Circular references
Any detected issues should be resolved before deployment.
Export SQL
Generated SQL can be:
- Copied to the clipboard
- Downloaded as a SQL file
- Shared with team members
- Stored in version control
Deployment
Depending on your project configuration, generated SQL may be executed against a connected database.
Before deployment:
- Review SQL carefully.
- Verify the target database.
- Confirm the deployment environment.
[!WARNING] Avoid deploying directly to production without testing the generated SQL in a development or staging environment.
Best practices
- Validate your schema before generating SQL.
- Use meaningful table and column names.
- Review SQL before deployment.
- Keep generated SQL under version control.
- Test SQL in a non-production environment first.