Export SQL
Use SQL export to inspect the DDL DBModeler will generate for the current diagram or for a saved version.
What export includes
Section titled “What export includes”Depending on the context, DBModeler can generate:
- full schema creation SQL
- migration SQL between versions
- engine-specific table and constraint statements
- accumulated custom SQL scripts
The exact output depends on the selected database engine and whether you are exporting the current diagram or a version snapshot.
Preview SQL before exporting
Section titled “Preview SQL before exporting”Open the SQL preview dialog before downloading or copying anything.
This lets you verify:
- quoted identifiers
- generated types and fallbacks
- table and constraint ordering
- foreign-key actions
- custom scripts included in the output
Previewing first is the fastest way to catch modeling or engine mismatches before the SQL leaves DBModeler.
Export a full schema
Section titled “Export a full schema”For an initial schema, DBModeler typically generates a full DDL sequence.
That sequence can include:
- pre-table custom scripts
- sequences or other helper objects when required by the engine
CREATE TABLEstatements- primary-key and foreign-key statements where the engine requires separate clauses
- post-table custom scripts
Export version SQL
Section titled “Export version SQL”For later versions, DBModeler generates migration-oriented SQL.
Instead of rebuilding the whole schema, the output is based on the diff between versions and can include ALTER TABLE statements for:
- added columns
- dropped columns
- modified columns
- renamed structures when the engine supports it
- changed constraints
Engine-specific caveats
Section titled “Engine-specific caveats”The catalog controls SQL generation details such as:
- identifier quoting style
- enum support
- sequence, identity, and auto-increment behavior
- supported foreign-key actions
This means a field may export differently on PostgreSQL, MySQL, Oracle, or SQL Server even when the logical model is the same.
What export does not do
Section titled “What export does not do”SQL export is focused on DDL. It does not try to generate application data migrations or arbitrary DML workflows for you.
If you need extra database logic around the generated DDL, use Custom SQL Scripts.
Next: Import SQL