Export SQL DDL from a database file
- Open the SQLite database.
- Open the ER diagram.
- Select SQL DDL as the export format.
- Export and save the generated schema text.
The result represents database structure rather than table data. It includes entity definitions, declared column types and key information that can be inferred from SQLite schema metadata.
Example output
CREATE TABLE "orders" (
"id" INTEGER PRIMARY KEY,
"customer_id" INTEGER NOT NULL,
"created_at" TEXT,
FOREIGN KEY ("customer_id") REFERENCES "customers" ("id")
);
What SQL DDL is useful for
- Reviewing a database schema in code review.
- Keeping structure changes in version control.
- Documenting tables without exposing production rows.
- Preparing a migration to another database system.
- Comparing expected and actual table definitions.
Migration note: SQLite syntax and type affinity differ from PostgreSQL, MySQL and SQL Server. Treat exported DDL as a reliable description of the SQLite schema, then adapt types, auto-increment behavior, quoting and constraints for the target engine.
Schema export versus database save
SQL DDL contains structure only. If you need the database with its rows and local edits, use Save DB. If you need rows in a portable text format, use the result export controls instead.