AI SQL Assistant for Database Work
Explain structures, SQL or errors, review optimization/syntax suggestions, draft SQL/CRUD/test data and ask for JOIN advice with carefully chosen context.
What can an AI-powered database tool do?
SqlOtter’s optional AI SQL assistant can explain queries, draft SQL and suggest changes with the context you choose to send. Configure a provider and review the generated SQL before you run it.
How it works
Use the workspace AI panel, Table → AI, the SQL editor AI menu, @mentions, /commands and $skills with an approved provider. Inspect the actual request scope and review the answer before copying or inserting it.
- Configure AI Settings: Provider, Base URL/Full URL, Chat Completions or Responses Wire API, model/Reasoning Effort, output language, streaming, timeout, proxy and local daily limit. Custom providers use Add/Remove/Set Default; Ollama needs an existing local endpoint/model.
- For SqlOtter Official, sign in, choose a current model/Effort and check available AI wallet credit. Get Models refreshes discovery; cached choices are not proof of availability. Desktop subscriptions/trials and AI wallet recharge remain separate.
- Official AI requires a server-confirmed supported location; mainland China and unknown locations are denied with HTTP 403 before catalog, wallet or upstream work. Hong Kong, Macao and Taiwan are outside this restriction. Retry Initial Request repeats the check; direct/custom providers are not covered by this Official-only gate.
- Read AI Data Processing Agreement and minimize conversation, SQL, connection/database/table/field mentions, sample rows/statistics and attachments. A field mention can include parent-table context; broad mentions can expand many objects.
- Ask a focused question or choose Explain Table, Generate Query, Generate CRUD SQL, Generate Test Data, Analyze Rows, Generate Field Comments or structure comparison. The editor also offers SQL Explain, Optimization, Syntax Checking, Generation and Fix With Error Message. These are AI drafts, not server parsing, EXPLAIN plans or benchmarks; table dialog OK and editor AI actions can send directly.
- Use Enter to send, Shift+Enter for a newline and picker Up/Down/Enter/Esc to choose or dismiss. During a response, nonempty input queues a follow-up that can send automatically; remove queued messages separately before Stop.
- Review each complete answer and code block. Copy answer copies text; Send to SqlEditor inserts at the cursor and Replace SqlEditor content replaces editor text/current Terminal Mode command. Check target/dialect/parameters before a separate execution decision.
- Use History/Search chat, Rename/Delete, New Chat and local Compact Context deliberately. Restore AI dialog when application launches is initially off. A safe fictional walkthrough can stop before Send/OK without generating anything. After New Chat, recheck pending composer text, chips and files.
Availability and limits
Current development implementation: Official AI requires a server-confirmed supported location, and provider, account, model and context access vary. Six authentic images illustrate configuration, controls and partial drafts; desktop and release acceptance remain pending.
- Schema only, Ask each time, Full data, Local only and Enable AI features are not uniformly enforced disclosure/network barriers across current chat/table paths. Review actual context; no all-path anonymization, guaranteed offline mode or per-message confirmation is established.
- Table actions can send up to 20 selected/first loaded visible sample rows (Explain Table: 10; dedicated test data: 0), plus applicable limited statistics. Hidden columns can retain metadata. These are loaded-view observations, not whole-database analysis.
- Attach file accepts PNG/JPG/JPEG/GIF/BMP/WebP and SQL/JSON/TXT, not PDF/Office/CSV/archives. Text is capped at 60000 captured characters; original names/paths can be disclosed. Image support depends on the model, and unsupported pasted paths become ordinary text.
- Official access needs an available service offering, authenticated account and sufficient available prepaid wallet credit. No free AI allowance or fixed model list is promised. Stop is best effort; uncertain official usage can remain reserved, and the local daily estimate is not the wallet ledger or a strict spending cap.
- Model/effort/settings changes affect future tasks; active requests and direct-provider retries keep their initial configuration. Custom routing uses the selected/default provider and model. Run AI Service Benchmark, Regenerate and ordinary-chat title generation can make additional chargeable requests.
- SQL/CRUD/test-data counts, error fixes, JOIN conditions, comments and compare-structure results are advisory. A skill prompt, LOW risk, VALID text or syntax highlighting does not prove server correctness or a completed database change.
- Copy/insert/replace does not execute SQL or system commands. Extra Review AI SQL / High-Risk AI SQL confirmation is conditional on dangerous workspace templates and classified risk; it is not a universal insertion preview. The editor target can differ from the mentioned object.
- Local application-level history retains messages, augmented context and file metadata; compacted memory can be sent again. New Chat, token removal or local deletion does not erase provider records or guarantee secure erasure. Withdraw AI Consent blocks new tasks but does not recall submitted data.
- The primary Settings still illustrates provider controls. The linked Docs guide also shows the empty panel, partial HIGH-risk CRUD draft, test-data request form, generation in progress and a partial test-data answer. Both answer views have incomplete prompt/SQL coverage. Generating and Stop controls do not prove cancellation; no copy/insert/execution outcome or SQL correctness is established. Physical-key, provider/engine workflow and named-release acceptance remain pending.