Cached row count (COUNT query or table reference)
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.
Header Parameters
Required when driver is postgresql
Set to no-cache to bypass cached count
Request Body
application/json
"athena" | "postgresql" | "supabase"Validated COUNT-only SQL (mutually exclusive with table_name)
Table name when not using raw query (mutually exclusive with query)
Schema name; defaults to public when using table_name
Response Body
application/json
curl -X POST "https://athena-cluster.com/query/count" \ -H "Content-Type: application/json" \ -d '{ "driver": "postgresql", "db_name": "athena_logging", "table_name": "http_request_log", "table_schema": "public" }'{
"status": "success",
"message": "Row count computed",
"data": {
"count": 2451,
"db_name": "athena_logging",
"duration_ms": 12,
"cache_lookup_outcome": "hit_local"
}
}Fetch data via GET GET
Compatibility GET wrapper for fetch semantics. Converts query string filters and paging inputs into an internal fetch-style request. Use `sort_by`/`sort_direction` for simple ordering and the aggregation query parameters for grouped output.
Execute SQL using selected driver POST
For `driver: postgresql`, connection resolution matches gateway handlers: send `X-Athena-Client` for a registered client pool, or `X-JDBC-URL` with a `jdbc:postgresql://...` URL for a direct connection (subject to gateway JDBC allowlists when configured).