{
 "schema_version": 1,
 "generated": "2026-10-30",
 "id": "t8y2-dbx--write-and-fix-sql-in-plain-language-with-dbx",
 "repo": "t8y2/dbx",
 "repo_url": "https://github.com/t8y2/dbx",
 "repo_slug": "t8y2-dbx",
 "title": "Write, explain and fix SQL in plain language with the DBX AI assistant",
 "page_title": "How to write, explain and fix SQL in plain language with the DBX AI assistant with DBX",
 "summary": "Highlight a table, describe what you want, and get SQL that runs through built-in safety checks.",
 "who": "An analyst or developer who knows what they need from the data but not the exact SQL.",
 "problem": "Copying SQL between a chat window and a database client is slow and error-prone.",
 "outcome": "Working SQL generated, explained or fixed inside the editor, checked before it runs.",
 "steps": [
  "Download DBX for macOS, Windows or Linux and connect a database",
  "Configure the AI SQL Assistant with Claude, OpenAI or a local model via Ollama",
  "Highlight a table and describe the result you want in plain language",
  "Ask it to explain or optimize the query, or fix an error message",
  "Run it with Cmd+Enter; destructive operations ask for confirmation"
 ],
 "agent_prompt": "In t8y2/dbx connected to <database>, use the AI SQL Assistant with <provider> to write a query that <goal>, explain it line by line, and optimize it before I run it.",
 "agents": [
  "any"
 ],
 "difficulty": "Beginner",
 "time": "10 minutes",
 "basis": "readme",
 "caveat": "",
 "category": "Data and analytics",
 "tags": [
  "Data and analytics"
 ],
 "lang": "rust",
 "requirements": [
  "macOS, Windows or Linux desktop, Docker for team access, or the web version",
  "An AI provider for the SQL assistant: Claude, OpenAI or a local model via Ollama",
  "Node.js (npx) for the MCP server"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/t8y2-dbx/write-and-fix-sql-in-plain-language-with-dbx/",
 "md": "https://dedupedai.com/use-cases/t8y2-dbx/write-and-fix-sql-in-plain-language-with-dbx/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/t8y2-dbx--write-and-fix-sql-in-plain-language-with-dbx.json",
 "api_version": "v1"
}
