Text to sql feature #52077
Replies: 2 comments
|
In a SQL editor: Use an AI-enabled editor or build a chat panel that generates SQL for your database. In your own application: Build a chat interface with an LLM, schema-aware SQL generation, and a database connection. |
|
Hey @tarunpahade18, hope you're doing well! Nice idea, and good news: a lot of this already lives in the dashboard SQL editor. In the SQL editor, press Cmd+Shift+K (Ctrl+Shift+K on Windows) to open the Generate SQL prompt. Describe what you want in plain words and it writes the SQL right in the editor as a diff for you to review and accept before running. Cmd+I opens the AI Assistant panel for a back and forth chat, and right clicking a selection gives you Explain Code. How well it knows your tables depends on one organization setting, under Organization settings, General, Data privacy, where you pick how much database info the AI can see. With Schema Only it gets table and column names plus relationships, so a prompt like "top 10 customers by order total" usually comes back with the right joins. If you meant a chat for your own app's users, @ManavNatekar's suggestion is the way to go, and the team just shared something close to that in #52171: your app gets its own MCP server so users can ask about their data from ChatGPT or Claude, and there's a Headless App block if you'd rather have the agent inside your own app. Each request runs as the signed in user, so your RLS policies decide what they can see. Was it the editor you had in mind, or a chat inside your own app? Happy to help with either. |
Uh oh!
There was an error while loading. Please reload this page.
chat and turn prompts to sql in sql editor
All reactions