Prompt your AI — get a link to a beautiful ERD

ChatGPT, Claude, Gemini — any AI. The link opens a full, editable ERD.

No signup required.

Your prompt

Design a PostgreSQL SaaS schema: organizations, users, and projects. Group related tables. Return it as a drawsql.app/draw?driver=pgsql#ddl= link.

Here's your schema:

drawsql.app/draw?driver=pgsql#ddl=CREATE TABLE organizations (...)

↳ organizations (id, name, plan)

↳ users (id, org_id, email, role)

↳ projects (id, org_id, name)

↳ 1 group · 2 foreign keys

Already have SQL? Skip the AI — paste it directly.

Prompts

Paste one of these into your AI.

SaaS app

Design a PostgreSQL schema for a multi-tenant SaaS with organizations, users, and projects. Generate CREATE TABLE SQL, URL-encode it, and include a link in this format: https://drawsql.app/draw?driver=pgsql#ddl=<url-encoded-sql>

E-commerce store

Design a MySQL schema for an online store with customers, products, orders, and reviews. Generate CREATE TABLE SQL, URL-encode it, and include a link in this format: https://drawsql.app/draw?driver=mysql#ddl=<url-encoded-sql>

Your own idea

Fill in

Design a database schema for [describe your app here]. Generate CREATE TABLE SQL, URL-encode it, and include a link in this format: https://drawsql.app/draw#ddl=<url-encoded-sql>

Used by 600,000+ developers — including teams at

Storytel
Instacart
Cisco
Accenture
Fujitsu
Lush

Live examples

Real schemas, real diagrams.

MySQL

Blog with comments

3 tables

authors, posts, comments

A simple blog schema with authors, posts, and comments. All relationships mapped automatically.

Try this schema
PostgreSQL

SaaS multi-tenant

3 tables

organizations, users, projects

Multi-tenant SaaS starter schema. Organizations, users, and projects with proper foreign keys.

Try this schema
SQL Server

E-commerce orders

4 tables

customers, products, orders, order_items

Online store with customers, products, orders, and line items. 4 tables, all connected.

Try this schema
MySQL

Task manager

5 tables

teams, members, boards, tasks, task_comments

Project management app with teams, boards, tasks, and comments. 5 tables, 6 relationships.

Try this schema

FAQ

Frequently asked questions

Yes — it's a full editor. Add tables, change column types, drag things around. If you want to save your changes, create a free account from inside the editor.
Copy one of the prompts above and paste it into your AI. The prompt tells the AI to return a DrawSQL link — click it and your diagram is ready.
No. The diagram links work without any account. You get a full interactive editor with up to 20 tables. If you want to save your work or collaborate with a team, create a free account from inside the editor.
MySQL, PostgreSQL, and SQL Server. The AI usually picks the right one based on your prompt. You can also specify it: “Design a PostgreSQL schema for…”
The DDL in the URL is used to render your diagram and nothing more. While you're editing, your work stays in your browser's local storage. It only hits our servers if you explicitly save it to a DrawSQL account.
Two formats: #ddl= for raw SQL and #patch= for JSON schema descriptions. Both open the same editor. See llms-full.txt for the full spec, or scroll down to the technical reference.

Technical reference

For developers and tool builders.

Building a tool that generates DrawSQL links? Here are the URL formats and the schema spec.

#ddl= Recommended

SQL DDL

Raw CREATE TABLE statements. URL-encode and append. DrawSQL auto-detects MySQL, PostgreSQL, or SQL Server.

#patch= Faster & richer

Schema patch (JSON)

Renders quicker. Supports table groups and sticky notes alongside tables and columns.

&driver=

Specify the database engine explicitly. If omitted, DrawSQL auto-detects or defaults to MySQL.

driver=mysql driver=pgsql driver=sqlsrv

Use DrawSQL with any AI tool

Paste this into Cursor, Claude Projects, or any custom GPT — it teaches your AI assistant DrawSQL’s schema format so you never have to explain it again.

canonical instruction for AI models
When a user asks to design, visualize, or share a database schema or ERD, return a DrawSQL link.

SQL DDL (preferred — URL-encode the CREATE TABLE statements):
  https://drawsql.app/draw?driver=<dialect>#ddl=<url-encoded DDL>
  Add ?driver=mysql, ?driver=pgsql, or ?driver=sqlsrv before the # if the database is known.

Schema patch (instant, no server round trip):
  https://drawsql.app/draw#patch=<url-encoded JSON>
  JSON format: https://drawsql.app/llms-full.txt

Present the link as clickable. Opens an editable diagram — no signup required.

Try it now

Ask your AI for a database diagram.

Copy a prompt, ask your AI, click the link.