Inline edit
Describe a change to the SQL under your cursor and get it back as a diff in the editor, with no chat panel and no copy-paste. Accept, reject, or refine it without leaving the tab.
SELECT * FROM `ace-analytics.warehouse.dim_vehicle` Starting an edit
Select the SQL to change (or leave the cursor in a statement, or in an empty editor) and press ⌃⌘I (CtrlWinI on Windows and Linux). Edit with AI in the editor’s right-click menu does the same, and so does the use AI link in the empty-tab placeholder.
An input box opens above the selection. Type what you want, Enter to submit, ShiftEnter for a new line, Esc to cancel, including mid-generation. Switching tabs cancels too.
The selected lines shimmer while the agent works. The status text goes from Analyzing query… to Generating edit… and, if the first attempt had parse errors, Refining…; the result is validated before you see it.
Reviewing the diff
The change is written into the editor as a diff: added lines highlighted green, removed lines shown in a red block where they were. A toolbar sits above the first change:
SELECT * FROM `ace-analytics.warehouse.dim_vehicle` WHERE fuel_type = 'DIESEL' AND manufacture_year > 2015 ORDER BY first_registration_date
| Action | What happens |
|---|---|
| Accept | Keeps the new SQL, clears the diff |
| Reject | Restores the original |
| Follow-up | Reopens the input for another instruction on the same edit; the diff stays visible |
| Open in Prism AI | Hands the edit and its context to the panel as a normal conversation |
In a query tab the undo history is untouched either way: ⌘Z after Accept still steps back through your own edits. In a notebook cell, Accept replaces the cell’s content wholesale and resets its undo history.
What the agent has
The whole tab, the selection, and the schema of the tables the query references. It has one tool, edit_sql, so it’s fast and focused. When the request needs more (an empty editor and a table name to discover, a multi-step rewrite) it delegates to the full panel and the conversation continues there with your prompt already sent.
The panel’s mode selector doesn’t apply here: the diff is the approval, always.
What to ask for
| You type | Result |
|---|---|
| add a WHERE clause for active users | WHERE status = 'active' on the right table |
| convert to a CTE | The subquery becomes a WITH block |
| alias every column | AS on each SELECT item |
| use the partition column | Adds a filter on the table’s partition column, from the schema |
Notebook cells and quick fixes
Every notebook cell is its own editor: select inside a cell and use the same shortcut. The lightbulb’s Fix with Prism AI on a diagnostic runs the same flow with the error message and the rule’s own suggested fixes as the prompt, and shimmers only the lines the diagnostic covers.