run_sql
Run a single read-only DuckDB SELECT or WITH against a named warehouse schema, capped at 500 rows and 10 seconds, returning rows, column units, row count, and a result_id for citation.
Instructions
Run one read only DuckDB statement against one warehouse schema. Only a single SELECT or WITH runs; writes, ATTACH, COPY, INSTALL, LOAD, PRAGMA, SET, file reading functions and tables outside the named schema are refused with the clause named. Unqualified table names are qualified with the warehouse. The limit is capped at 500 rows and the statement stops after 10 seconds. Returns the statement as it ran, the columns with units where the catalog knows them, the rows, the row count before the limit, and a result_id to cite in readback.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| limit | No | ||
| warehouse | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | the statement as it ran, normalized, with the limit applied | |
| rows | Yes | ||
| limit | Yes | ||
| digest | Yes | ||
| columns | Yes | ||
| result_id | Yes | a handle for readback in the same request chain | |
| row_count | Yes | rows the statement returns before the limit | |
| statement | No | Answers are drawn from the published tables of three portfolio builds by Ajay Mekala: doorstep (public housing data from FHFA, the Census Bureau, HUD, the CFPB and Freddie Mac), turnaround (public flight data from the Bureau of Transportation Statistics, the FAA and OurAirports, with weather from Open-Meteo under CC BY 4.0) and ledger (a fictional bank, Harborline, with public HMDA, CFPB, FDIC and macro series). No person appears in any table, and questions are redacted before a model sees them. Every number is read back to the warehouse before it is shown. This is a portfolio demonstration, not financial, travel or lending advice. | |
| warehouse | Yes | ||
| elapsed_ms | Yes |