Skip to content
This repository was archived by the owner on Mar 29, 2026. It is now read-only.

fix: handle non-SELECT read queries (SHOW, DESCRIBE, EXPLAIN) in run_sql tool#1129

Open
nagasumanthila wants to merge 1 commit into
vanna-ai:mainfrom
nagasumanthila:fix/run-sql-read-queries
Open

fix: handle non-SELECT read queries (SHOW, DESCRIBE, EXPLAIN) in run_sql tool#1129
nagasumanthila wants to merge 1 commit into
vanna-ai:mainfrom
nagasumanthila:fix/run-sql-read-queries

Conversation

@nagasumanthila

Copy link
Copy Markdown

Problem

The run_sql tool currently determines query type using only the first SQL keyword and treats only "SELECT" queries as returning data. However, several SQL commands such as SHOW, DESCRIBE / DESC, and EXPLAIN also return tabular result sets. These are incorrectly treated as data manipulation queries, resulting in misleading responses like "Query executed successfully. X row(s) affected."

Solution

  • Added support for additional read query types: SELECT, SHOW, DESCRIBE, DESC, EXPLAIN, WITH
  • Added comments explaining why these queries are treated as read queries

Result

  • Non-SELECT read queries now correctly return tabular data
  • Prevents hallucinations caused by missing schema information

…sql tool- Added READ_QUERY_TYPES - Added comments explaining why these queries are treated as read queries
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant