{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/cdata/main/json-schema/cdata-query-search-result-schema.json",
  "title": "QuerySearchResult",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cdata-log-api-openapi.yml#/components/schemas/QuerySearchResult",
  "type": "object",
  "properties": {
    "queries": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/QueryRecord"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "QueryRecord": {
      "type": "object",
      "properties": {
        "credential": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's credential used to execute the query."
        },
        "duration": {
          "type": "integer",
          "format": "int64",
          "description": "The duration of the query in milliseconds."
        },
        "drivers": {
          "type": [
            "string",
            "null"
          ],
          "description": "The driver used to execute the query."
        },
        "errorCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "In the case of an error, the error code."
        },
        "errorMessage": {
          "type": [
            "string",
            "null"
          ],
          "description": "The error message of the query, if applicable."
        },
        "logVerbosity": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "The verbosity level of the query log."
        },
        "query": {
          "type": [
            "string",
            "null"
          ],
          "description": "The contents of the query."
        },
        "queryId": {
          "type": "string",
          "format": "uuid",
          "description": "The unique Id of the query."
        },
        "queryType": {
          "$ref": "#/$defs/QueryType",
          "description": "The type of query."
        },
        "rowsAffected": {
          "type": "integer",
          "format": "int64",
          "description": "The number of rows affected by the query."
        },
        "rowsReturned": {
          "type": "integer",
          "format": "int64",
          "description": "The number of rows returned by the query as a result set."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of the query."
        },
        "userAgent": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user agent used to execute the query."
        }
      },
      "additionalProperties": false
    },
    "QueryType": {
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        20,
        100,
        101,
        102,
        103,
        104,
        105,
        106,
        107,
        108,
        109,
        200,
        201,
        202,
        203,
        204,
        205,
        210,
        211,
        212,
        220,
        230,
        231,
        232
      ],
      "type": "integer",
      "format": "int32",
      "description": "| Value | Name |\n|-------|------|\n| 0 | Drivers |\n| 1 | DriverInfo |\n| 2 | TestConnection |\n| 3 | GetOAuthAuthorizationUrl |\n| 4 | GetOAuthAccessToken |\n| 5 | CustomReportInfo |\n| 6 | GenerateCustomReport |\n| 7 | GetAPIRootPaths |\n| 8 | GetAPIColumns |\n| 9 | GetAPIRows |\n| 10 | GetTimeCheckColumns |\n| 11 | GetDynamicPropValues |\n| 20 | DisconnectOAuthAccessToken |\n| 100 | Catalogs |\n| 101 | Schemas |\n| 102 | Tables |\n| 103 | Columns |\n| 104 | PrimaryKeys |\n| 105 | ImportedKeys |\n| 106 | ExportedKeys |\n| 107 | Procedures |\n| 108 | ProcedureParameters |\n| 109 | Indexes |\n| 200 | Query |\n| 201 | QuerySchemaOnly |\n| 202 | Batch |\n| 203 | Exec |\n| 204 | Caching |\n| 205 | ScheduledQuery |\n| 210 | ODataServiceDocument |\n| 211 | ODataMetadata |\n| 212 | ODataQuery |\n| 220 | OpenAPIDocument |\n| 230 | CreateDerivedView |\n| 231 | AlterDerivedView |\n| 232 | DropDerivedView |\n"
    }
  }
}