Skip to content

Add query separation awareness and consider a "Run Query" code lens #362

@jthomasmock

Description

@jthomasmock

When sending code to the console, Positron currently lacks start/end cell awareness. This creates a jarring experience for users coming from R or Python workflows, you currently have to manually highlight an entire chunk to send it to the console.

Somewhat adjacent I think there's more of a bug/issue where the initial line is sent but not executed.

Proposed Solutions

  1. Statement-aware "Send to Console"
    Once we have LSP support, use it to detect the start and end of the statement surrounding the cursor, allowing the whole statement to be sent to console without manual selection. (Related context: Fix regressions in vs code extension #257)
  2. "Run Query" Code Lens
    Add a code lens action above SQL queries so users can run a query with a single click, without needing to select text manually.
  3. IPython-style cell delimiters (fallback)
    If full cell/statement awareness isn't yet feasible, maybe we want to support IPython-style manual cell delimiters (e.g., # %%) so users can define cell boundaries explicitly in .gsql files. However, various SQL variations have a separate indicator for comments, such as -- comment for single line and /* multiline */.

I think that 1 or 2 are attractive for more "portable SQL code" and the use of ggsql as a more 'pure' SQL runtime if folks were going to convert to a .sql file or run the queries outside of ggsql proper.

Metadata

Metadata

Assignees

Labels

integrationThis is about integration of ggsql with other tools

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions