Skip to main content

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.

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

  1. Click Add Provider… and pick a type (GitHub Copilot, Claude, OpenAI, Gemini, OpenRouter, Ollama, or a custom OpenAI-compatible endpoint).
  2. Enter the API key, or run device-flow sign-in for Copilot.
  3. Pick a model. The list fetches automatically; click Reload if needed.
  4. Click Test Connection.
API keys are stored in the macOS Keychain. Ollama is detected at launch.

Active Provider

The active provider handles every AI request. Switch it 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.

Chat

Press Cmd+Shift+L, click the AI toolbar button, or use View > Toggle AI Chat.
AI chat panel
Type a question and press Return. The AI receives your database type, schema, and current query. Code blocks have Copy and Insert to Editor buttons. Token counts show below each response.
Code block actions
Token usage
Conversations auto-save and auto-title from your first message. Browse, clear, or start a new one from the panel header.
Conversation history
Failed responses show Retry. Successful ones show Regenerate. Click Stop to cancel a streaming response.
Streaming response

Inline Suggestions

Toggle Enable inline suggestions while typing in the AI tab. The active provider drives suggestions. Press Tab 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
Default shortcuts:
ActionShortcut
Toggle AI ChatCmd+Shift+L
Explain with AICmd+L
Optimize with AICmd+Option+L
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 on)
  • Include current query (default on)
  • Include query results (default off)
  • Max schema tables (default 20)

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