Preview Question Sql
POST/v1/questions/preview
Run candidate SQL live and return {columns, rows, row_count}.
The rows-returning twin of validate-sql (which is a LIMIT 0 probe and
returns columns only). The editor's Live Preview used to POST to
{question_id}/execute, which runs the SAVED question — so editing the SQL
and pressing RUN PREVIEW showed the OLD query's rows under the new query's
heading, with nothing marking them stale. A brand-new question has no id, so
preview was unavailable there entirely.
Needs no question_id, which is what lets the editor preview before the
first save. Metered like execute (require_credits): it runs real SQL.
Request
Responses
- 200
- 404
- 422
Successful Response
Not found
Validation Error