feat: add batch SQL execution support for MCP (#70)

* feat: add batch SQL execution support for MCP

- Add sql field to QueryResult to track executed query
- Implement execute_batch_sqls_for_mcp for executing multiple SQL
- Use sqlparse to split and execute multiple SQL in single request
- Improve error handling in execute_batch_queries
- Return multiple results format when batch queries are detected

* test: add multi-SQL statements test for query executor
This commit is contained in:
zzzzwc
2025-12-24 12:45:29 +08:00
committed by GitHub
parent e58361e04b
commit 43143f0b30
3 changed files with 137 additions and 6 deletions

View File

@@ -59,6 +59,7 @@ class QueryResult:
metadata: dict[str, Any]
execution_time: float
row_count: int
sql: str
class DorisConnection:
@@ -132,6 +133,7 @@ class DorisConnection:
metadata=metadata,
execution_time=execution_time,
row_count=row_count,
sql=sql
)
except Exception as e: