Skip to content

feat(sql): run the statement at the cursor, splitter with offsets (#1148) - #1186

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1148-sql-run-at-cursor-shortcuts
Oct 9, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1148-sql-run-at-cursor-shortcuts

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Refs #1148

Changes

  • SqlStatementSplitter returns statement ranges (start, end, line). Semicolons inside string literals, quoted identifiers, comments and PostgreSQL dollar quotes do not end a statement.
  • SqlStatementSplitter.at(spans, offset): a caret inside a statement picks it; a caret on a blank line or after the last ; takes the statement above.
  • DestructiveSqlDetector.splitStatements is built on the same scanner, so the destructive check and the cursor lookup split the same way.
  • Ctrl/Cmd+Enter, Ctrl/Cmd+R and numpad Enter run the selection, else the statement at the cursor.
  • F5 and Ctrl/Cmd+Shift+Enter run the selection, else the whole script (as before, sent as one string).
  • Tests: splitting on quotes, comments, dollar quoting and empty statements; offsets and lines; caret inside, on a blank line, after the last ;, before the first statement, and in an empty script.

Not in this PR

  • Script run one statement at a time with stop at the first error and the status Statement k of n failed (line L) — the driver still receives the whole script as one string.
  • The Run ▾ split button, the destructive check per run over the statements that will actually run, and one history entry per run.
  • Ctrl/Cmd+H (query history) and removal of F11 from the reference.

🤖 Generated with Claude Code

)

SqlStatementSplitter returns statement ranges (start, end, line) and picks the
statement at a caret: inside a statement, a caret on a blank line or after the
last ; takes the statement above. Semicolons inside string literals, quoted
identifiers, comments and PostgreSQL dollar quotes do not end a statement.
DestructiveSqlDetector.splitStatements is built on the same scanner.

Ctrl/Cmd+Enter, Ctrl/Cmd+R and numpad Enter run the selection or the statement
at the cursor. F5 and Ctrl/Cmd+Shift+Enter run the selection or the whole
script.
@github-actions github-actions Bot added enhancement New feature or request editor Code/SQL editor ux User experience, keyboard shortcuts and interactions P2 Medium priority / Parity & Refactoring labels Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Grid scroll benchmark

metric base PR change
p50 11.01 ms 13.60 ms +23.5% ⚠️
p90 21.14 ms 23.81 ms +12.6% ⚠️
p99 47.36 ms 54.27 ms +14.6% ⚠️
stutters 296.00 292.00 -1.4%

Informational only (threshold 5%). Shared CI runners are noisy; re-run before trusting a single result.

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 364cf56 into dev Oct 9, 2026
14 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/1148-sql-run-at-cursor-shortcuts branch October 11, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editor Code/SQL editor enhancement New feature or request P2 Medium priority / Parity & Refactoring ux User experience, keyboard shortcuts and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant