run_sql
Execute a SQL query against a fresh ephemeral in-memory database built from your schema (and optional seed rows). Returns real rows (max 500, truncation flagged), column names+types, row_count, and dialect notes. Errors come back as structured JSON with type/position/suggestion — a failed query is a useful answer, not a failure of this tool. Example: schema "CREATE TABLE t(id INTEGER, name TEXT);", query "SELECT name FROM t WHERE id=1", seed {"t":[{"id":1,"name":"ada"}]} → rows [["ada"]].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Optional seed rows: {"table_name": [{"col": value, ...}, ...]}. Max 10MB total. | |
| query | Yes | ONE SQL statement to execute. Stacked statements are rejected. | |
| engine | No | Engine. Server-side supports 'sqlite' (default). 'duckdb' runs in the browser demo at sqlai.dev only. | |
| schema | Yes | DDL statements (CREATE TABLE ...; multiple statements allowed). |