| 210 | const READ_ONLY_PREFIXES = /^\s*(SELECT|EXPLAIN|SHOW|DESCRIBE|DESC|PRAGMA|WITH)\b/i; |
| 211 | |
| 212 | export class DbQueryTool extends Tool<z.infer<typeof DbQueryArgs>> { |
| 213 | name = 'db_query'; |
| 214 | description = 'Run a SQL query against the database. By default ONLY SELECT/EXPLAIN/SHOW/DESCRIBE/PRAGMA are allowed (safe). Pass allow_write=true for mutating statements — these are DESTRUCTIVE and cannot be /restored by QodeX (remote DB state). Use prepared-statement params to avoid injection.'; |
| 215 | isReadOnly = false; // can be destructive with allow_write |
nothing calls this directly
no outgoing calls
no test coverage detected