Import your schema

Paste in your existing schema — a SQL dump, a DBML file, or a Rails schema.rb — and DrawSQL turns it into a diagram: tables, columns, indexes, and foreign keys drawn as relationships, all laid out on the canvas. Nothing to redraw by hand.

Supported formats

  • SQL (DDL) — CREATE TABLE dumps from MySQL, PostgreSQL, or SQL Server. The most common path: dump your live database and paste it in.

  • DBML — the database markup language used by dbdiagram.io and dbdocs.

  • Rails schema.rb — drop in your Rails app's schema file, references and all.

  • DrawSQL JSON — re-import a DrawSQL JSON export to restore a backup or copy a diagram between workspaces.

How to import

Import menu
  1. In the diagram editor, click File, then Import.

  2. Paste your schema, upload the file, or fetch it straight from a public GitHub repo (see below).

  3. DrawSQL auto-detects the format. If it guesses wrong, pick the right one from the format dropdown.

  4. Click Begin Import, then review the import log — anything that couldn't be carried over is listed there.

Want to try it without an account? The /draw playground takes the same paste, upload, and GitHub imports — no login required.

Fetch from GitHub

The GitHub tab in the import dialog fetches a schema file from any public repo. Paste a link to the file itself, or just the repo URL — DrawSQL checks the conventional locations for you:

  • db/schema.rb and db/structure.sql (Rails)

  • database/schema/mysql-schema.sql and database/schema/pgsql-schema.sql (Laravel's schema:dump output)

Importing into a diagram that already has tables

Imports add to your diagram — they never wipe it. Everything is parsed in your diagram's dialect (a MySQL diagram imports as MySQL). When the import contains a table name that already exists on the canvas, you choose what happens: Keep both tables or Override existing. Handy for re-importing after your schema changed.

Each plan has a per-diagram table limit. If your schema is larger, the importer brings in what fits and the import log lists what was left out.

Still have a question? We'd love to help!