Docs

DrawSQL AI

Type "Build me a SaaS app with teams, projects, and tasks" and watch the tables, relationships, and indexes appear on your canvas. DrawSQL AI is a schema design assistant built into the editor — describe what you need in plain language, and it builds it. You can also review, refactor, or ask questions about an existing schema.

🔒 DrawSQL AI is available on all paid plans. Requires edit access to the diagram.

Quick start

  1. Click the sparkle icon in the top right toolbar to open the AI chat panel.

  2. Click Enable DrawSQL AI to get started — you only need to do this once.

  3. Type your request and press Enter. Use the quick action buttons if you're not sure where to start: Generate schema, Review schema, Explain schema, and Add tables.

What you can do

Generate a schema from scratch

Describe your application and the AI creates the full schema for you — tables, columns, relationships, indexes, and groups.

Try: "Build a schema for a SaaS project management tool with teams, projects, tasks, and comments"

That prompt above creates something like this:

 teams        → id, name, slug, owner_id, created_at, updated_at
users        → id, name, email, password, team_id, created_at, updated_at
projects     → id, name, description, team_id, created_at, updated_at
tasks        → id, title, description, status, priority, project_id, assignee_id, due_date, created_at, updated_at
comments     → id, body, task_id, user_id, created_at, updated_at

Plus foreign keys, indexes on the lookup columns, a group called "Project Management" wrapping everything together, and sticky notes with follow-up questions about your design. The more context you give in your prompt, the more tailored the output.

Review your schema

Ask the AI to audit your diagram for design issues — missing indexes, naming inconsistencies, normalization problems, missing timestamps, weak relationships. Results appear as suggestion cards you can apply individually, batch-apply, or dismiss.

Try: "Review my schema for issues"

Refactor an existing schema

Working with a legacy or inherited schema? Ask the AI to clean it up:

  • Rename columns to match your conventions

  • Add missing foreign keys

  • Split wide tables into smaller ones

  • Add junction tables for many-to-many relationships

Try: "Rename all columns to snake_case and add missing foreign keys"

Ask questions

You don't have to change anything — just ask. The AI can explain your current structure, identify how tables relate to each other, or help you understand design patterns in your diagram. It references your actual table and column names, not generic advice.

Try: "How do users relate to organizations?" or "Explain the permissions model"

Organize your layout

Ask the AI to arrange your tables on the canvas so nothing overlaps. Especially useful after generating a large schema, importing from SQL, or when your diagram has grown messy over time.

Try: "Organize my tables" or "Layout my schema"

Undoing changes

All changes from a single AI response are batched — one Ctrl+Z (or Cmd+Z) reverts the entire response. You'll also see a diff summary after each change so you can verify what was added, updated, or removed.

Conversations

Conversations save locally in your browser (not synced across devices). If you close the editor and come back, your conversation is restored automatically.

Use /new or the reset button to start fresh. For best results, start a new conversation periodically — long threads lose context. You can also click the stop button to cancel a response mid-stream.

AI credits

Each paid plan includes a monthly AI credit allocation per team member. Your remaining credits are shown in the chat panel header menu.

  • Simple questions use fewer credits than large schema generation requests.

  • Credits reset monthly on your billing cycle date and don't roll over.

  • There's a daily soft limit to spread usage across the month — you'll see a warning but can keep going.

  • When credits are fully exhausted, AI chat is unavailable until the next reset.

Tips for best results

  • Be specific. "Add a polymorphic comments table for posts and tasks" works better than "add comments."

  • Work in sections. For large schemas, build one domain at a time (users and auth, then billing, then content) rather than everything at once.

  • Iterate. Generate a first pass, review it, then ask the AI to adjust. "Make the tags table polymorphic" or "add soft deletes to all tables" are great follow-ups.

  • Start fresh when switching topics. If you're done with one task and starting another, use /new for a clean conversation.

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