Export to SQL (DDL)
Design your schema on the canvas, then export it as a ready-to-run .sql file in your diagram's dialect — MySQL, PostgreSQL, or SQL Server. Run it against an empty database and your schema exists for real.
Exporting
In the diagram editor, click File → Export.
Pick the SQL export matching your diagram's DBMS (MySQL, PostgreSQL, or SQL Server).
Click Start export — the
.sqlfile downloads automatically.
Have tables selected on the canvas? The export scopes to your selection, so you can hand a teammate just one domain of a big schema.
The file contains a CREATE TABLE per table — columns, primary keys, indexes, and comments included — with foreign keys added as ALTER TABLE statements at the end, so tables can be created in any order.
Running the export
# MySQL / MariaDB
mysql -u USERNAME -p DATABASE < export.sql
# PostgreSQL
psql -d DATABASE -f export.sql
# SQL Server
sqlcmd -S SERVER -d DATABASE -i export.sql
Sample export output
CREATE TABLE `regions`(
`region_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`region_name` VARCHAR(25) NULL
);
CREATE TABLE `countries`(
`country_id` CHAR(2) NOT NULL,
`country_name` VARCHAR(40) NULL,
`region_id` INT NOT NULL
);
ALTER TABLE
`countries` ADD PRIMARY KEY(`country_id`);
CREATE TABLE `departments`(
`department_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`department_name` VARCHAR(30) NOT NULL,
`location_id` INT NULL
);
ALTER TABLE
`countries` ADD CONSTRAINT `countries_region_id_foreign` FOREIGN KEY(`region_id`) REFERENCES `regions`(`region_id`);