ask — simple count question
An English sentence becomes a Plan tree, then SQL, then rows. The response carries the compiled SQL so the planner is never a black box.
curl -X POST "$ENGINE/v1/tenants/$T/ask" \
-H "Authorization: Bearer $OC_TOKEN" \
-H "Content-Type: application/json" \
-d @- <<'JSON'
{
"question": "how many customers do I have?"
}
JSON {
"sql": "SELECT COUNT(*) AS n FROM shop.customers",
"rows": [
{ "n": 4218 }
],
"count": 1,
"plan_cache": "miss",
"elapsed_ms": 412
}