Run a raw SQL query against the selected PostgreSQL pool
Executes raw SQL against the client selected by `X-Athena-Client`. This route is intended for advanced workflows where structured gateway payloads are insufficient. Use carefully with parameterized SQL on the caller side when constructing dynamic queries.
Header Parameters
selects which PostgreSQL pool the SQL executes against
optional API key mirror of the apikey header in the body
Request Body
application/json
raw SQL to execute
Response Body
application/json
curl -X POST "https://athena-cluster.com/gateway/query" \ -H "X-Athena-Client: string" \ -H "Content-Type: application/json" \ -d '{ "query": "SELECT id, path, status_code FROM http_request_log ORDER BY created_at DESC LIMIT 10;" }'{
"status": "success",
"message": "Query executed",
"data": {
"rows": [
{
"id": "5d845b27-8d06-40a0-9e76-08de9d9f3c1f",
"path": "/gateway/fetch",
"status_code": 200
}
]
}
}Insert a row into a table PUT
Inserts one row (or server-normalized payload) into the target table selected by `X-Athena-Client`. The optional `X-Athena-Insert-Window` header can enable request-scoped batching for Postgres-backed inserts. Conflict responses (409) are typically raised for unique/constraint violations.
Execute a Postgres function as RPC POST
Invokes `schema.function(arg => ...)` on the pool selected by `X-Athena-Client`. Requires API key with right `gateway.rpc.execute`. Success responses return **`{"data": [...], "count": ...}`** (not the usual `status`/`message` envelope). Rows are JSON objects keyed by selected columns.