On this page

AI assistant

The StitchDB AI assistant answers questions about your project and the docs, writes SQL and policies for you to review, and explains and fixes queries.

#Where it appears

  • Ask AI in the dashboard header, the command palette, or Ctrl/⌘ + I. It knows which project you're in.
  • SQL Editor: Generate SQL from a description, Explain query, and Fix on an error.
  • Policies: Write policy with AI.
  • Table Editor: Generate with AI for a new table.
  • Docs: Ask AI about this page (when you're signed in).

#What it can do

  • Read your project's schema: tables, columns, keys, RLS status, policies, enums, functions, triggers, indexes, extensions and buckets.
  • Run read-only queries to answer questions: one statement at a time, inside a read-only transaction, 5 second timeout, at most 200 rows.
  • Propose SQL, policies and tables. The assistant never runs a proposal itself: you run it with Run in the panel (as you, exactly like the SQL Editor; SQL that changes data or schema asks for confirmation first), put it in the editor, or fill the open form with Apply to form.

#What it can't do

  • Change data or schema. Statements other than SELECT, WITH, VALUES, TABLE, EXPLAIN and SHOW are refused, as are functions with side effects.
  • Read secrets: Vault, cron, queues, HTTP requests and password hashes are off limits, and values that look like keys or tokens are redacted from results.
  • Work on projects you don't own, or on paused or suspended projects. Without a project selected it has no database access at all.

#Daily limits

PlanRequests per day
Free20
Pro200
Scale1,000

Limits reset at midnight UTC; the panel shows how many you have used. There is also a limit of 10 requests per minute and 2 conversations at a time.

#Your data

Your question, a summary of your schema and the results of read-only queries are sent to the AI model to answer. StitchDB does not store prompts or answers, only request counts. The conversation is kept in your browser tab.