export_query
Run a SQL query and stream results directly to a CSV or JSONL file on disk, using constant memory and zero tokens for large data exports.
Instructions
Execute a SQL query and stream results directly to a local CSV or JSONL file on disk. Zero token consumption, constant O(1) memory usage, ideal for large query exports.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | Optional path to SQLite database file. Defaults to configured default database. | |
| sql | Yes | The SQL query to execute and export to disk. | |
| format | No | Export file format: 'csv' (comma-separated values) or 'jsonl' (line-delimited JSON). | csv |
| params | No | Optional query parameters (positional list, named dict, or JSON string). | |
| target_file | Yes | Destination file path on disk (e.g. 'output.csv' or 'data.jsonl'). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |