surfaceq & aask_data_sql
Q & Ascalar · returns varchar

ASK_DATA_SQL

Return the SQL that ASK_DATA would run, without executing it

Per-row — runs once for each row.

qallmtext

Arguments

nametypedescription
questionVARCHARNatural language question about your data

About

Generate the SQL for a plain-English question about your data — without running it. Useful for auditing queries before execution, reviewing or hand-modifying generated SQL, or copying it out for use in another tool. Works exactly like ASK_DATA: it introspects your attached databases and produces a complete SELECT statement, then stops short of executing. Shares its cache with ASK_DATA, so once a question has been answered via either operator the other gets an instant cache hit. Two related operators: ask_data_sql(question) — this one: returns the generated SQL ASK_DATA(question) — generates and runs, returns JSON rows

Examples

Returns SQL statement

SELECT
  ask_data_sql ('select 1')

Nearby rabbit holes

same domain
Climb back to The Looking Glass