Skip to Content
DocsDatabase EngineeringForward Engineering

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 Deploy

Generate SQL

To generate SQL:

  1. Open your Database Schema.
  2. Complete the database design.
  3. Open Forward Engineering.
  4. Select the target database system.
  5. Validate the schema.
  6. Generate SQL.
  7. Review the generated script.
  8. Export or deploy the SQL.

Supported output

Depending on your project configuration, Qubase may generate:

OutputDescription
CREATE DATABASECreate a new database
CREATE TABLECreate database tables
ALTER TABLEModify existing tables
CREATE INDEXCreate indexes
FOREIGN KEYGenerate relationships
CHECKValidation constraints
DEFAULTDefault 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.

Related guides

Last updated on