{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dpf-it-com/json-schema/dpf-it-com-query-response-schema.json",
  "title": "QueryResponse",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dpf-it-com-openapi.yml#/components/schemas/QueryResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "type": "object",
      "properties": {
        "columnTypes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "duckdbType": {
                "type": "string"
              },
              "typeOid": {
                "type": "integer",
                "description": "PostgreSQL type OID (for wire-protocol/JDBC consumers)"
              }
            }
          },
          "description": "Typed column descriptors for the result set."
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          },
          "description": "Array of row objects (column name → value). Capped at 1000 rows — see `truncated`/`resultUrl` when the true result is larger.\n"
        },
        "rowCount": {
          "type": "integer",
          "description": "Number of rows in `rows` (the returned/capped set, at most 1000). When `truncated` is true this is NOT the true total — see `totalRowCount`.\n"
        },
        "truncated": {
          "type": "boolean",
          "description": "True when the query's true result exceeded the 1000-row inline cap."
        },
        "totalRowCount": {
          "type": [
            "integer",
            "null"
          ],
          "description": "True total row count. Present only when `truncated` is true."
        },
        "resultUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "Presigned S3 GET URL to the full (uncapped) result as a gzip-compressed CSV (`.csv.gz`; `Content-Type: application/gzip` on GET). The response body is the raw gzip bytes — it is not auto-decompressed via `Content-Encoding`, so it must be explicitly gunzipped. Present only when `truncated` is true, and only if the spillover write succeeded — a truncated result can still come back without a resultUrl.\n"
        },
        "executionTimeMs": {
          "type": "integer",
          "description": "Total execution time in milliseconds (includes setup)"
        }
      }
    }
  }
}