AI Assistant
Built-in AI for writing, explaining, optimizing, and fixing SQL. One active provider drives every AI feature: chat, inline suggestions, editor actions, and fix-error. The chat panel has three modes (Ask, Edit, Agent). It can call tools to inspect your schema, take context from@ mentions, and run templates from / slash commands. Provider keys stay in the macOS Keychain. Per-connection rules and tool whitelists sync via iCloud with the connection.
Configure a Provider
Open Settings (Cmd+,) > AI. The tab is modeled on Xcode’s Intelligence settings: a single Active Provider picker at the top, a list of configured providers below, and a detail sheet when you drill into one.


AI settings
Add a Provider
- Click Add Provider… and pick a type: GitHub Copilot, ChatGPT, Cursor, Claude, OpenAI, OpenRouter, OpenCode Zen, Gemini, Ollama, or a custom OpenAI-compatible endpoint.
- Enter the API key, or sign in for Copilot and ChatGPT.
- Enter a model name, or pick one from the fetched list. Click Reload if needed.
- Click Test Connection.
Active Provider
The active provider handles every AI request. Override it per turn from the model picker in the chat composer. Change the default from the Active Provider picker at the top of the AI tab.GitHub Copilot
Add Copilot like any other provider. The detail sheet runs GitHub’s device-flow sign-in: enter the displayed code on github.com to authorize. The Copilot language server starts when you add a Copilot provider and stops when you remove it. Copilot supports tool calling through GitHub’sconversation/registerTools bridge. Tool calls go through the same approval flow as the other providers.
ChatGPT
Sign in with your ChatGPT account to use the Codex quota included with Plus, Pro, Business, and Enterprise plans, with no API key. The detail sheet opens your browser to sign in, then captures the redirect on a local callback. Tokens are stored in the macOS Keychain and refreshed automatically. If you already use the Codex CLI, click Import from Codex CLI to reuse that login. The active provider then serves chat and inline suggestions from the subscription models (GPT-5.5, GPT-5.4, GPT-5.4 Mini). This uses an unofficial OpenAI interface that may change, and access follows OpenAI’s terms.Cursor
Use your Cursor subscription for AI chat and inline suggestions, two ways:- API key: paste a key from the Cursor dashboard. Stored in the macOS Keychain like other provider keys. Calls Cursor’s Cloud Agents API.
- Sign in with the Cursor CLI: leave the key blank and click Sign in with Cursor. This needs the Cursor CLI installed (
curl https://cursor.com/install -fsS | bash); the button runsagent loginin your browser, and chat runs through the localagentcommand. No key to paste.
Chat
PressCmd+Shift+L, click the inspector toggle and pick AI Chat, or use View > Toggle AI Chat. The right inspector has a Details / AI Chat segmented picker at the top.


AI chat panel


Code block actions


Token usage


Conversation history
Chat Modes (Ask / Edit / Agent)
The mode picker in the composer footer controls which tools the AI can call. The mode sticks across turns until you change it. New chats start in Ask.
Mode and safe mode are independent gates. Picking Agent does not bypass safe mode: the write-confirm dialog still fires when safe mode is Confirm Writes or higher.
Tool Calling
In Edit and Agent modes, the AI can call tools to look up your database or run queries. Each tool call appears in the assistant’s reply as a card. For read-only tools, the call runs immediately. For write-side tools, the card shows three buttons:- Run: approve this single call.
- Always for this connection: approve and add the tool to this connection’s whitelist (
Connection.aiAlwaysAllowedTools). Future calls of the same tool on this connection skip the prompt. - Cancel: reject the call. The model gets an error result and continues.


Per-card tool approval


Streaming response with tool calls
Available Tools
Provider support: Claude, OpenAI, OpenRouter, OpenCode Zen, Gemini, Ollama (model-dependent), GitHub Copilot, and custom OpenAI-compatible endpoints.
Attach Context with @
Type @ in the composer to anchor a picker at the caret. Pick from:
- Schema: every table’s columns and foreign keys.
- A specific Table: that table’s columns and foreign keys only.
- Current Query: whatever’s in the active editor tab.
- Query Results: the most recent query result snapshot.
- Saved Query: pick one of your starred queries to send its name and SQL alongside the message.
@ button next to the composer opens the same picker as a menu.
Attached items show as chips in the composer. Saved query chips resolve when you send, so the AI sees whatever’s in the saved query at send time, not when you attached it.
Slash Commands
Type/ (or click the ⌘ button next to the composer) to run a command. Built-ins:
/explain: explain the active query./optimize: suggest optimizations for the active query./fix: fix the last error against the active query./help: list the commands inline in the chat.
Custom Slash Commands
Add your own under Settings > AI > Custom Slash Commands. A command needs a name, an optional description, and a prompt template. Templates take these placeholders, substituted at send time:{{query}}: the current editor query.{{schema}}: the formatted schema for the active connection (capped by Max schema tables in AI settings).{{database}}: the active database name.{{body}}: text typed after the command. For example,/review WHERE clausespassesWHERE clausesas{{body}}.
Inline Model Picker
Next to the mode picker is a model picker (cpu icon) listing every configured provider and its models. Pick one to override the active provider for the current turn. The label shows your pick; clear it to fall back to the active provider. The override is per turn, not per chat. The next turn starts from the active provider unless you pick again.Per-Connection AI Rules
Pin context to a connection so the AI sees it on every chat turn against that database. Open the connection’s edit form and pick AI Rules in the sidebar (sparkles icon). Rules are plain text. Use them for facts the schema does not show:- Table conventions:
Tables prefixed with tmp_ are scratch and safe to ignore. - Join keys:
users.email_hash is the join key, not users.email. - Soft deletes:
Always filter orders by deleted_at IS NULL. - PII to avoid:
Never select users.ssn or users.dob. - Business rules:
Active accounts have status = 'active' AND verified_at IS NOT NULL.
## Connection-Specific Rules heading, after the schema and any attached context. Rules sync via iCloud, so they apply on every device tied to the connection.
Inline Suggestions
Toggle Enable inline suggestions while typing in the AI tab. The active provider drives suggestions. PressTab to accept, Esc to dismiss.
With Copilot active, suggestions come from Copilot’s inline-completion model. With any other active provider, suggestions come from chat completions.
Editor Actions
Right-click SQL in the editor for Explain with AI and Optimize with AI.

Editor context menu
Customize under Settings > Keyboard > AI.
Ask AI to Fix
Query error dialogs include an Ask AI to Fix button. It opens chat with the failed query and error pre-filled.

Ask AI to Fix
Context
Under Settings > AI > Context:- Include database schema (default off)
- Include current query (default off)
- Include query results (default off)
- Max schema tables (default 20)
New installs default these toggles to off. The AI then only sees what you attach with
@ mentions or what tool calls pull in. Turn the toggles on to auto-include context on every turn. Existing installs keep their previous values.Privacy
Set a per-connection AI policy in the connection form: Use Default, Always Allow, Ask Each Time, or Never. New connections default to Ask Each Time.

Per-connection AI policy
External AI Clients
External clients (Raycast, Cursor, Claude Desktop, and other MCP clients) call the same AI tools through the External API. Two per-connection settings gate them:- AI policy decides whether the connection is reachable by AI clients at all.
Neverblocks every external AI tool call against this connection. - External Access caps the level:
blocked,readOnly(default), orreadWrite. A token’s effective permission isMIN(token.scope, connection.externalAccess). Set this in the connection form’s Advanced tab.
