DDLBuilderOpen DDLBuilder
DDLBuilder
Open DDLBuilder
Docs / Advanced guide

Import CREATE TABLE SQL and edit database schemas

Open the DDLBuilder workspace and follow the import steps below. After importing related tables, check their foreign keys and ER diagram, then generate ORM models.

This guide explains how to import existing SQL scripts or field-definition files (CSV, Excel, JSON Schema) as editable table schemas.

When to use

Use this when you refactor a legacy system, migrate an old project's database, or create tables from third-party API definitions or an Excel data dictionary.


Steps

1. Import single-table or multi-table SQL

  1. Click Import in the sidebar, or choose Import Schema from the New menu. You can also press ⌘K (Ctrl K on Windows / Linux) and search for Import schema. To save several tables at once, set Import mode to Save as saved tables.
  2. Set Source Type to SQL, choose the Source Database, and paste the SQL script. It can contain one or more CREATE TABLE, CREATE INDEX, ALTER TABLE and GRANT statements.
  3. Click Next to validate the syntax and parse the table structure.
  4. Review and adjust the result:
    • When importing into the workspace, the preview shows the parsed columns, data types, primary keys, indexes and grantees. You can edit column names, types and nullability, move columns up or down, or delete them. Then click Next.
    • With Save as saved tables, there is no column preview. Select the tables to import, click Next, then choose a Target Folder and a Conflict Strategy: Skip existing, Overwrite existing or Auto rename.
  5. Click Import (or Confirm Import when saving as saved tables). If the SQL uses a schema prefix (for example CREATE TABLE sales.orders), sales goes into Schema Name and orders into Table Name.

2. Import field-definition files (CSV / Excel / JSON Schema)

For actual order records or customer lists, use Business Data Import. CSV / Excel imports on this page read field-definition lists.

  1. Click Import in the sidebar and choose a Source Type:
    • CSV / TSV: The first row is a header (field name, field type, field comment). Each following row describes one field.
    • Excel (.xlsx / .xls): Each worksheet becomes one table, named after the sheet. Row 1 is the header (field name, field type, field comment), and each following row is one field.
    • JSON Schema / OpenAPI: Reads the fields in properties with their types, formats and descriptions.
  2. Upload the file, click Next, check the fields and types in the preview, and edit them as needed.
  3. Click Import to write the fields to the current workspace.

Supported formats and parser behavior

Source / formatSupported syntax and requirementsParser behavior
SQL scriptsCREATE TABLE, CREATE INDEX, ALTER TABLE, GRANTExtracts column constraints, defaults, comments, composite indexes and grants
CSV filesUTF-8 encoded, comma-delimited, header rowReads field names, explicit SQL types and comments
Excel files.xlsx and .xls workbooksReads field-definition lists from each worksheet
JSON SchemaJSON Schema, Swagger or OpenAPI documentsExtracts properties and maps field types from type and format; object and array map to json

Verification checklist

  • The workspace shows the parsed table names, columns, constraints and indexes.
  • If the source SQL has a schema prefix, Schema Name and Table Name hold the two parts.
  • The DDL and DCL in the output area match the syntax of the target database.

Notes and troubleshooting

Dialect mismatch

If the import reports a syntax error, first check that Source Database in the import dialog matches the SQL's actual syntax, for example Oracle SQL with MySQL selected.

  • One SQL import accepts up to 50,000 characters. Split larger scripts by business module.
  • Save CSV files as UTF-8. Remove password protection from Excel files before uploading.
  • Nested object and array properties in a JSON Schema import as a single json field. To get separate tables, split the entities in the JSON Schema before importing.

Last updated:

Need more help?

Start with the FAQ. If that does not solve it, tell us.

When to useSteps1. Import single-table or multi-table SQL2. Import field-definition files (CSV / Excel / JSON Schema)Supported formats and parser behaviorVerification checklistNotes and troubleshooting