Skip to content

Export SQL

Use SQL export to inspect the DDL DBModeler will generate for the current diagram or for a saved version.

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.

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.

For an initial schema, DBModeler typically generates a full DDL sequence.

That sequence can include:

  1. pre-table custom scripts
  2. sequences or other helper objects when required by the engine
  3. CREATE TABLE statements
  4. primary-key and foreign-key statements where the engine requires separate clauses
  5. post-table custom scripts

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

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.

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