query_database
Executes read-only SQL queries to retrieve Canadian statistical data from the database. Returns results as columns and rows for analysis.
Instructions
Executes a read-only SQL query (SELECT or PRAGMA) against the database and returns the results. WARNING: Potential security risk! Avoid using this tool with untrusted input or queries that modify data (INSERT, UPDATE, DELETE). Prefer more specific tools like list_tables or get_table_schema when possible. Results may be truncated.
Args: query_input: Object containing the sql_query string.
Returns: Dict[str, Any]: Dictionary with 'columns', 'rows' (list of dicts), and optionally a 'message', or an error message.
IMPORTANT: In your final response to the user, you MUST cite the source of your data (e.g., "Query results from table 'my_analysis'").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql_query | Yes | The SQL query to execute. |