AI SQLite Editor
AI-powered SQLite editor for VSCode — natural language to SQL, schema-aware briefing, inline error explanations.
Built by Ciro Cesar Maciel — because every other SQLite editor still makes you write SQL by hand.
I built this extension for myself. I work with SQLite databases every day and was tired of bouncing between a read-only browser and a SQL prompt every time I wanted to ask a simple question of my own data. Existing tools either gave me a viewer with no brains, or a query console with no awareness of the schema in front of it. So I built the database manager I actually wanted to use — and I'm sharing it.
Open a .db file → browse your schema → ask it questions in plain English → get editable SQL back, ready to run.
✨ Double-click any .db / .sqlite / .sqlite3 file and the editor opens with a data briefing of what's inside. Hit ⌘K to ask anything.
Think of it as ChatGPT for your SQLite database, or Copilot for SQL — but local-first, model-agnostic, and pay-per-token. Your .db file stays on your machine; only your question + schema metadata is sent to the model you pick.
Why this one?
- Full database client + AI layer in one. Browse schemas, run queries, edit rows, alter structure — and on top of all of that, ask in natural language and let the model write the SQL. Both are one click apart.
- Bring your own model. Any of the 300+ models on OpenRouter — Gemini 2.5 Flash, Claude Sonnet 4.5, GPT-4o, DeepSeek, Qwen Coder, Llama, Mistral. Switch whenever a new one drops.
- Pay-per-token. No subscription. A typical NL→SQL roundtrip costs a fraction of a cent with Gemini Flash.
- No vendor lock-in. Your key, your account, your bill.
- Explains errors in plain English. SQL error? The editor tells you what went wrong and offers a one-click fix.
- Auto data briefing. Open a database and it summarizes the schema, suggests questions, picks a starter table for you.
- Proactive insights. When you open a table, the editor surfaces anomalies, suspicious patterns, and candidate filters as quick chips.
- Works on
.db, .sqlite, .sqlite3. No conversion, no import, no separate app — open the file directly in VSCode.
How it compares
|
AI SQLite Editor |
SQLite Browser / DB Browser |
DBeaver |
SQLTools |
Open .db in VSCode |
✅ |
❌ (separate app) |
❌ (separate app) |
⚠️ via driver |
| Inline row editing |
✅ |
✅ |
✅ |
❌ |
| Schema / structure management |
✅ |
✅ |
✅ |
⚠️ limited |
| Natural language → SQL |
✅ BYOK |
❌ |
❌ |
⚠️ paid AI add-on |
| Schema-aware AI briefing |
✅ |
❌ |
❌ |
❌ |
| Inline error explanations |
✅ |
❌ |
❌ |
❌ |
| Model freedom (Gemini/Claude/GPT/…) |
✅ 300+ |
— |
— |
⚠️ single provider |
| Pricing |
Pay-per-token (your key) |
Free |
Free / Pro |
Free / paid add-on |
Setup
- Get an API key from openrouter.ai/keys.
- Open Settings (
Cmd+,) → search SQLite Editor.
- Paste your key into
sqlite3-editor.openrouter.apiKey.
- Pick a model from the dropdown in
sqlite3-editor.openrouter.modelId — or run SQLite Editor: Select AI Model from the Command Palette to browse the live list with prices and context windows.
| Setting |
What it does |
sqlite3-editor.openrouter.apiKey |
Your OpenRouter key (sk-or-...). |
sqlite3-editor.openrouter.modelId |
Any model slug from OpenRouter. Defaults to google/gemini-2.5-flash. |
sqlite3-editor.openrouter.baseUrl |
OpenRouter API base — change only if you proxy through a custom gateway. |
sqlite3-editor.proactiveInsights |
Auto-scan a table for anomalies and patterns when you open it (one LLM call per table). |
sqlite3-editor.pythonPath |
Path to the Python binary used by the SQLite engine. Leave empty to auto-detect. |
Use it
Open any SQLite file:
- Double-click a
.db / .sqlite / .sqlite3 file in the Explorer — the editor opens as the default viewer.
- Read the data briefing at the top: schema summary, suggested questions, table picker.
- Hit
⌘K (or Ctrl+K on Windows/Linux) to open the Ask AI palette. Type intent in plain English → review the generated SQL → run it.
- Edit cells inline, alter tables, manage schema — all from the editor grid. Changes hit the database directly.
- SQL error? Click the inline explanation to get a plain-English description and a one-click fix.
Want a keyboard shortcut for something else? Open the Keybindings UI, search for "SQLite Editor" and bind any combo you like.
FAQ
Does it work offline?
The SQLite editing layer (open / browse / edit / query) works 100% offline. Only AI features (NL→SQL, briefing, error explanations, insights) need internet — they call OpenRouter with your key.
Does it send my database to OpenAI / Anthropic / Google?
No. Your .db file stays on your machine. Only your question plus schema metadata (table names, column names, types) is sent to the model you pick. Row data is sent only if you explicitly include it in a prompt or paste it.
Which model should I pick?
Default is google/gemini-2.5-flash — cheap, fast, surprisingly good at NL→SQL. Bump to anthropic/claude-sonnet-4.5 or openai/gpt-4o when the schema gets complex or queries get gnarly. Run SQLite Editor: Select AI Model to browse live prices.
What about encrypted (SQLCipher) databases?
Not supported yet — standard .db / .sqlite / .sqlite3 only.
Why OpenRouter and not direct OpenAI / Anthropic keys?
One key, 300+ models, one bill, pay-per-token, no subscription. You can switch from Gemini to Claude to GPT mid-session without changing config. Plus, every new model that drops shows up automatically.
How much does it cost to use?
That depends on the model. With the default google/gemini-2.5-flash, a typical NL→SQL question is fractions of a cent. Claude Sonnet 4.5 is roughly 30-50x more per query but still pennies. You set hard spend limits in your OpenRouter dashboard.
Can I disable the proactive insights?
Yes — set sqlite3-editor.proactiveInsights to false. You can still trigger insights manually from the chips bar.
About me
I'm a developer building tools I want to use. More of my stuff at ciromaciel.click.
If this saved you time, send it to a friend who still copy-pastes SELECT * FROM from Stack Overflow.
Credits
Originally forked from the excellent vscode-sqlite3-editor by yy0931. The AI layer, redesign, and reimagined direction are mine.
Build from source
npm install
cd packages/extension
npm run release # bump + build + package → .vsix
Proprietary — see LICENSE.
Keywords: sqlite editor, sqlite viewer, sqlite browser for vscode, ai sqlite, sqlite ai assistant, natural language to sql, nl2sql, text-to-sql, ai database client, ai database editor, sql copilot, gpt for sqlite, claude for sql, gemini sql, openrouter sql, database editor vscode, .db editor, .sqlite editor, sqlite3 viewer, llm sql, ai data exploration.