Skip to content

Conversation

@tianzhou
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings December 26, 2025 09:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds SQL selection functionality to the SQL editor, allowing users to execute only the selected portion of SQL code rather than the entire content. This is a common feature in SQL development tools that improves developer productivity.

Key changes:

  • Exposed a getSelectedSql() method from SqlEditor via a ref handle to retrieve either the selected text or full content
  • Updated ToolDetailView to use the selected SQL when executing queries for execute_sql tools
  • Implemented the ref pattern using forwardRef and useImperativeHandle to access editor selection state

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
frontend/src/components/tool/SqlEditor.tsx Added SqlEditorHandle interface and getSelectedSql() method using forwardRef and useImperativeHandle to expose editor selection state
frontend/src/components/tool/index.ts Exported the new SqlEditorHandle type for external consumption
frontend/src/components/views/ToolDetailView.tsx Added ref to SqlEditor and updated execution logic to use selected SQL when available

@tianzhou tianzhou merged commit d5a3d54 into main Dec 26, 2025
2 checks passed
@tianzhou tianzhou deleted the select-query branch December 26, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants