What
Draw a run button in the editor gutter next to each SQL statement, and give the statement under the cursor a faint background.
A query tab can already hold many statements, but nothing on screen shows where one ends and the next begins. Running just one means putting the cursor in the right place and remembering a shortcut.
Why
This is the notebook-style editing people ask for: several queries in one tab, each runnable on its own. DataGrip, DBeaver and the Supabase SQL editor all do it with a plain SQL file plus a gutter affordance. The document stays a single string, so persistence, undo and autocomplete are untouched.
Scope
- A run button on the first line of each statement. It runs that statement only.
- A faint background over the range of the statement under the cursor.
- Statement ranges come from
SQLStatementScanner.locatedStatementAtCursor, which already handles dialects and comment-only segments.
- The button belongs in the vendored CodeEditSourceEditor
Gutter module. The editor is not an NSTextView, so NSLayoutManager decoration APIs are not available.
Not this
Real notebook cells, meaning a document made of separate cell buffers with markdown in between. That is a different document model and a different product decision.
What
Draw a run button in the editor gutter next to each SQL statement, and give the statement under the cursor a faint background.
A query tab can already hold many statements, but nothing on screen shows where one ends and the next begins. Running just one means putting the cursor in the right place and remembering a shortcut.
Why
This is the notebook-style editing people ask for: several queries in one tab, each runnable on its own. DataGrip, DBeaver and the Supabase SQL editor all do it with a plain SQL file plus a gutter affordance. The document stays a single string, so persistence, undo and autocomplete are untouched.
Scope
SQLStatementScanner.locatedStatementAtCursor, which already handles dialects and comment-only segments.Guttermodule. The editor is not anNSTextView, soNSLayoutManagerdecoration APIs are not available.Not this
Real notebook cells, meaning a document made of separate cell buffers with markdown in between. That is a different document model and a different product decision.