validate_query
Validate SQL queries for safety and compliance before execution by checking statement types, blocked commands, read-only mode, and potential issues like missing WHERE clauses.
Instructions
Check if a query is safe to execute without running it.
Validates the query against:
- Statement type (SELECT, INSERT, UPDATE, DELETE, DDL, EXEC)
- Blocked commands list
- Read-only mode compliance
- Potential issues (missing WHERE clause, unbounded SELECT)
Args:
query: SQL statement to validate
Returns:
Dictionary with:
- query: The original query
- valid: Whether the query is valid
- statement_type: Type of SQL statement
- warnings: List of warning messages
- suggestions: List of suggested improvements
- error: Error message if invalidInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||