Execute SQL via driver
For `driver: postgresql`, connection resolution matches gateway handlers: - Send `X-Athena-Client` for a registered client pool, or - Send direct PostgreSQL URI headers (`x-pg-uri` preferred; `x-athena-jdbc-url` / `x-jdbc-url` compatibility). For PostgreSQL driver requests, Athena accepts direct URI auth bypass (no `X-Athena-Client`, no `X-Athena-Key`) when the URI includes both username and password credentials. Non-PostgreSQL drivers still require standard auth. Optional `schema_name` is supported only for the PostgreSQL driver and configures execution search_path as `schema_name, public`.
Header Parameters
Registered Athena client name for client-routed execution.
Preferred direct PostgreSQL URI (postgres://... or jdbc:postgresql://...) for driver=postgresql.
Compatibility direct PostgreSQL URI header.
Compatibility direct PostgreSQL URI header.
Required for non-PostgreSQL drivers and for PostgreSQL requests without credentialed direct URI bypass.
Request Body
application/json
"athena" | "postgresql" | "supabase"Optional schema override; supported only when driver is postgresql.
Response Body
application/json
curl -X POST "https://athena-cluster.com/query/sql" \ -H "Content-Type: application/json" \ -d '{ "query": "string", "driver": "athena", "db_name": "string" }'{}Cached row count (COUNT query or table) POST
Returns a single row count using the same cache layers as gateway fetch (in-process + Redis when configured). Provide either validated `query` (single SELECT COUNT ... with no GROUP BY / UNION / comments) or `table_name` with optional `table_schema` (default `public`). `Cache-Control: no-cache` bypasses the cache. Responses include `X-Athena-Cached`, `X-Athena-Cache-Outcome`, and `X-Athena-Cache-Source` when applicable.
Legacy alias for `/gateway/fetch` POST
Mirrors `/gateway/fetch` for clients still calling `/gateway/data` with the same payload/response envelope. Supports `X-Athena-Client` or direct PostgreSQL URI headers (`x-pg-uri` preferred; `x-athena-jdbc-url` / `x-jdbc-url` compatibility).