Forward Engineering lets users export their SqlDBM data model as SQL scripts — ready to run in a database environment. Users can generate a full script to create all objects from scratch, or an alter script that captures only what changed between two revisions.
SqlDBM can also forward engineer dbt source and model YAML. For more information, see the related article at the end of this page.
Getting started
Note that SqlDBM will not make any changes to your database directly. The generated script should be run manually once it has been reviewed.
The Forward Engineering panel is accessed via the Forward Engineering button in the left pane.
The Forward Engineering panel
The panel is divided into three sections:
- Configuration (left) — defines what kind of script to generate and how.
- Objects or Revisions (center) — determines what is included in the script.
- Generate script (right) — previews, copies, and exports the output.
Step 1 — Configuration
Format and script type selection
The Format and Type are selected using the cards at the top of the Configuration panel.
Format
- DDL — generates SQL statements (CREATE, ALTER, DROP). Selected by default.
- dbt / YAML — generates dbt-compatible YAML. See YAML generation for dbt for more information.
Type (available when DDL is selected)
- Full script — generates a complete script for all selected objects. Selected by default.
- Alter script — generates only the changes between two revisions.
A short description below the cards confirms what will be generated based on the selection.
Settings
Once the format and type are selected, the Settings section updates to show the relevant options.
Default action
The Default action dropdown sets the SQL action applied to all objects in the generated script. The options available depend on the database — for example, Snowflake supports Create, Create or replace, and Drop, while SQL Server supports Create, Create or alter, and Drop.
An informational note below the dropdown explains exactly how the selected action will behave, including any object types where the action differs.
Safe script
The Safe script option adds IF [NOT] EXISTS clauses to the generated statements, preventing errors if an object already exists or doesn't exist yet. This option is available for all databases except Oracle.
The informational note updates to reflect the combined behavior of the Default action and Safe script selection.
Quote options
The Quote options dropdown controls how object names are quoted in the generated SQL. The available options depend on the database:
| Database | Options |
| Snowflake | Respect object's 'Use quotes' property, Double quotes |
| SQL Server / Azure Synapse | Double quotes, Square brackets, Empty |
| Databricks / BigQuery | Backticks, Empty |
| PostgreSQL / Oracle / AlloyDB / Amazon Redshift | Double quotes, Empty |
| MySQL | Double quotes, Backticks, Empty |
Override action per object type
If a different behavior for a specific object type is needed, Set different actions per object type can be enabled to reveal a dropdown for each available object in the database. This lets the user override the Default action for individual object types — for example, using Drop for Tables while keeping Create for everything else.
Some object types include additional options when a custom action is set — such as index type checkboxes or partition controls.
Step 2 — Select objects or a revision
Full script — object selection
The center panel shows the object tree, organized by type (Tables, Views, Procedures, etc.). The search bar can be used to filter by name. All selected objects will be included in the generated script.
Tip: Objects selected on a diagram or in the Database Explorer before opening Forward Engineering will carry over automatically.
Alter script — revision selection
When Alter script is selected, the center panel shows the available project revisions. The revision selected will be compared against the current model — SqlDBM will generate a script with only the changes between the two.
Note: Unsaved changes will not appear in the alter script until they have been saved to a revision.
Step 3 — Generate and export
Once the settings and objects are configured, the Generate script panel on the right produces the output.
- Generate SQL (full script) or Generate alter script — produces the script based on the selected objects and settings.
- Copy — copies the script to the clipboard.
- Erase — clears the output to start over.
- Push to Git — sends the script directly to a connected Git repository, if configured.
Review the generated script on the next screen and run it in your database environment.
See also