AI-powered SQL assistant injected directly into DbGate as a side panel.
The plugin patches DbGate's Electron main process to add a WebContentsView with an AI chat interface. It connects to your databases through DbGate's saved connections and uses the OpenAI API to answer questions, write and execute SQL queries.
- DbGate installed at
/Applications/DbGate.app(macOS) - Node.js >= 18
- pnpm
- An OpenAI API key
pnpm installpnpm dbgateThis command builds the Vue frontend, extracts DbGate's app.asar, patches it to inject the AI panel, and launches a modified copy of DbGate.
A robot icon appears at the bottom of DbGate's left icon bar. Click it to toggle the AI chat panel.
macOS will block the modified app because its code signature is no longer valid. To allow it:
- When the error appears, open System Settings > Privacy & Security
- Scroll down — you'll see a message about "DbGate" being blocked
- Click Open Anyway
Alternatively, run this before launching:
xattr -cr /tmp/DbGate-AI.appThis only needs to be done once (or again after DbGate updates).
On first use, click the gear icon in the chat panel to configure:
- API Key — your OpenAI API key
- Model — the model to use (defaults to
gpt-4o)
launcher/launch-dbgate.jsextracts DbGate'sapp.asarto/tmp/dbgate-ai-patched/- It patches
src/electron.jsto loadai-panel.json startup - A temporary
.appbundle is created at/tmp/DbGate-AI.app(cached between runs) - The AI panel loads the Vue frontend from
dist/index.htmlin aWebContentsView - IPC handlers (prefixed
aichat:) handle database connections, queries, and AI chat
launcher/ Injection into DbGate (CommonJS, runs in DbGate's main process)
src/ Backend logic (config, AI agent, database drivers)
renderer/ Vue 3 frontend (Pinia, Tailwind CSS v4)
dist/ Build output
data/ Runtime data (config, conversation history) — git-ignored